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
cbabccc3
Commit
cbabccc3
authored
Jun 26, 2010
by
Måns Rullgård
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffv1: remove VLAs
Originally committed as revision 23802 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
02591641
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
14 deletions
+19
-14
ffv1.c
libavcodec/ffv1.c
+19
-14
No files found.
libavcodec/ffv1.c
View file @
cbabccc3
...
@@ -237,6 +237,7 @@ typedef struct FFV1Context{
...
@@ -237,6 +237,7 @@ typedef struct FFV1Context{
uint8_t
state_transition
[
256
];
uint8_t
state_transition
[
256
];
int
run_index
;
int
run_index
;
int
colorspace
;
int
colorspace
;
int_fast16_t
*
sample_buffer
;
DSPContext
dsp
;
DSPContext
dsp
;
}
FFV1Context
;
}
FFV1Context
;
...
@@ -509,14 +510,14 @@ static inline int encode_line(FFV1Context *s, int w, int_fast16_t *sample[2], in
...
@@ -509,14 +510,14 @@ static inline int encode_line(FFV1Context *s, int w, int_fast16_t *sample[2], in
static
void
encode_plane
(
FFV1Context
*
s
,
uint8_t
*
src
,
int
w
,
int
h
,
int
stride
,
int
plane_index
){
static
void
encode_plane
(
FFV1Context
*
s
,
uint8_t
*
src
,
int
w
,
int
h
,
int
stride
,
int
plane_index
){
int
x
,
y
,
i
;
int
x
,
y
,
i
;
const
int
ring_size
=
s
->
avctx
->
context_model
?
3
:
2
;
const
int
ring_size
=
s
->
avctx
->
context_model
?
3
:
2
;
int_fast16_t
sample_buffer
[
ring_size
][
w
+
6
],
*
sample
[
ring_size
];
int_fast16_t
*
sample
[
3
];
s
->
run_index
=
0
;
s
->
run_index
=
0
;
memset
(
s
ample_buffer
,
0
,
sizeof
(
sample_buffer
));
memset
(
s
->
sample_buffer
,
0
,
ring_size
*
(
w
+
6
)
*
sizeof
(
*
s
->
sample_buffer
));
for
(
y
=
0
;
y
<
h
;
y
++
){
for
(
y
=
0
;
y
<
h
;
y
++
){
for
(
i
=
0
;
i
<
ring_size
;
i
++
)
for
(
i
=
0
;
i
<
ring_size
;
i
++
)
sample
[
i
]
=
s
ample_buffer
[(
h
+
i
-
y
)
%
ring_size
]
+
3
;
sample
[
i
]
=
s
->
sample_buffer
+
(
w
+
6
)
*
((
h
+
i
-
y
)
%
ring_size
)
+
3
;
sample
[
0
][
-
1
]
=
sample
[
1
][
0
];
sample
[
0
][
-
1
]
=
sample
[
1
][
0
];
sample
[
1
][
w
]
=
sample
[
1
][
w
-
1
];
sample
[
1
][
w
]
=
sample
[
1
][
w
-
1
];
...
@@ -539,15 +540,15 @@ static void encode_plane(FFV1Context *s, uint8_t *src, int w, int h, int stride,
...
@@ -539,15 +540,15 @@ static void encode_plane(FFV1Context *s, uint8_t *src, int w, int h, int stride,
static
void
encode_rgb_frame
(
FFV1Context
*
s
,
uint32_t
*
src
,
int
w
,
int
h
,
int
stride
){
static
void
encode_rgb_frame
(
FFV1Context
*
s
,
uint32_t
*
src
,
int
w
,
int
h
,
int
stride
){
int
x
,
y
,
p
,
i
;
int
x
,
y
,
p
,
i
;
const
int
ring_size
=
s
->
avctx
->
context_model
?
3
:
2
;
const
int
ring_size
=
s
->
avctx
->
context_model
?
3
:
2
;
int_fast16_t
sample_buffer
[
3
][
ring_size
][
w
+
6
],
*
sample
[
3
][
ring_size
];
int_fast16_t
*
sample
[
3
][
3
];
s
->
run_index
=
0
;
s
->
run_index
=
0
;
memset
(
s
ample_buffer
,
0
,
sizeof
(
sample_buffer
));
memset
(
s
->
sample_buffer
,
0
,
ring_size
*
3
*
(
w
+
6
)
*
sizeof
(
*
s
->
sample_buffer
));
for
(
y
=
0
;
y
<
h
;
y
++
){
for
(
y
=
0
;
y
<
h
;
y
++
){
for
(
i
=
0
;
i
<
ring_size
;
i
++
)
for
(
i
=
0
;
i
<
ring_size
;
i
++
)
for
(
p
=
0
;
p
<
3
;
p
++
)
for
(
p
=
0
;
p
<
3
;
p
++
)
sample
[
p
][
i
]
=
s
ample_buffer
[
p
][(
h
+
i
-
y
)
%
ring_size
]
+
3
;
sample
[
p
][
i
]
=
s
->
sample_buffer
+
p
*
ring_size
*
(
w
+
6
)
+
((
h
+
i
-
y
)
%
ring_size
)
*
(
w
+
6
)
+
3
;
for
(
x
=
0
;
x
<
w
;
x
++
){
for
(
x
=
0
;
x
<
w
;
x
++
){
int
v
=
src
[
x
+
stride
*
y
];
int
v
=
src
[
x
+
stride
*
y
];
...
@@ -631,6 +632,10 @@ static av_cold int common_init(AVCodecContext *avctx){
...
@@ -631,6 +632,10 @@ static av_cold int common_init(AVCodecContext *avctx){
assert
(
s
->
width
&&
s
->
height
);
assert
(
s
->
width
&&
s
->
height
);
s
->
sample_buffer
=
av_malloc
(
6
*
(
s
->
width
+
6
)
*
sizeof
(
*
s
->
sample_buffer
));
if
(
!
s
->
sample_buffer
)
return
AVERROR
(
ENOMEM
);
return
0
;
return
0
;
}
}
...
@@ -823,6 +828,8 @@ static av_cold int common_end(AVCodecContext *avctx){
...
@@ -823,6 +828,8 @@ static av_cold int common_end(AVCodecContext *avctx){
av_freep
(
&
p
->
vlc_state
);
av_freep
(
&
p
->
vlc_state
);
}
}
av_freep
(
&
s
->
sample_buffer
);
return
0
;
return
0
;
}
}
...
@@ -885,14 +892,13 @@ static av_always_inline void decode_line(FFV1Context *s, int w, int_fast16_t *sa
...
@@ -885,14 +892,13 @@ static av_always_inline void decode_line(FFV1Context *s, int w, int_fast16_t *sa
static
void
decode_plane
(
FFV1Context
*
s
,
uint8_t
*
src
,
int
w
,
int
h
,
int
stride
,
int
plane_index
){
static
void
decode_plane
(
FFV1Context
*
s
,
uint8_t
*
src
,
int
w
,
int
h
,
int
stride
,
int
plane_index
){
int
x
,
y
;
int
x
,
y
;
int_fast16_t
sample_buffer
[
2
][
w
+
6
];
int_fast16_t
*
sample
[
2
];
int_fast16_t
*
sample
[
2
];
sample
[
0
]
=
s
ample_buffer
[
0
]
+
3
;
sample
[
0
]
=
s
->
sample_buffer
+
3
;
sample
[
1
]
=
s
ample_buffer
[
1
]
+
3
;
sample
[
1
]
=
s
->
sample_buffer
+
w
+
6
+
3
;
s
->
run_index
=
0
;
s
->
run_index
=
0
;
memset
(
s
ample_buffer
,
0
,
sizeof
(
sample_buffer
));
memset
(
s
->
sample_buffer
,
0
,
2
*
(
w
+
6
)
*
sizeof
(
*
s
->
sample_buffer
));
for
(
y
=
0
;
y
<
h
;
y
++
){
for
(
y
=
0
;
y
<
h
;
y
++
){
int_fast16_t
*
temp
=
sample
[
0
];
//FIXME try a normal buffer
int_fast16_t
*
temp
=
sample
[
0
];
//FIXME try a normal buffer
...
@@ -921,16 +927,15 @@ static void decode_plane(FFV1Context *s, uint8_t *src, int w, int h, int stride,
...
@@ -921,16 +927,15 @@ static void decode_plane(FFV1Context *s, uint8_t *src, int w, int h, int stride,
static
void
decode_rgb_frame
(
FFV1Context
*
s
,
uint32_t
*
src
,
int
w
,
int
h
,
int
stride
){
static
void
decode_rgb_frame
(
FFV1Context
*
s
,
uint32_t
*
src
,
int
w
,
int
h
,
int
stride
){
int
x
,
y
,
p
;
int
x
,
y
,
p
;
int_fast16_t
sample_buffer
[
3
][
2
][
w
+
6
];
int_fast16_t
*
sample
[
3
][
2
];
int_fast16_t
*
sample
[
3
][
2
];
for
(
x
=
0
;
x
<
3
;
x
++
){
for
(
x
=
0
;
x
<
3
;
x
++
){
sample
[
x
][
0
]
=
s
ample_buffer
[
x
][
0
]
+
3
;
sample
[
x
][
0
]
=
s
->
sample_buffer
+
x
*
2
*
(
w
+
6
)
+
3
;
sample
[
x
][
1
]
=
s
ample_buffer
[
x
][
1
]
+
3
;
sample
[
x
][
1
]
=
s
->
sample_buffer
+
(
x
*
2
+
1
)
*
(
w
+
6
)
+
3
;
}
}
s
->
run_index
=
0
;
s
->
run_index
=
0
;
memset
(
s
ample_buffer
,
0
,
sizeof
(
sample_buffer
));
memset
(
s
->
sample_buffer
,
0
,
6
*
(
w
+
6
)
*
sizeof
(
*
s
->
sample_buffer
));
for
(
y
=
0
;
y
<
h
;
y
++
){
for
(
y
=
0
;
y
<
h
;
y
++
){
for
(
p
=
0
;
p
<
3
;
p
++
){
for
(
p
=
0
;
p
<
3
;
p
++
){
...
...
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