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
d9ced4ca
Commit
d9ced4ca
authored
Jul 02, 2003
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup / cosmetics
Originally committed as revision 2001 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
085565f7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
26 deletions
+22
-26
ffv1.c
libavcodec/ffv1.c
+22
-26
No files found.
libavcodec/ffv1.c
View file @
d9ced4ca
...
...
@@ -353,31 +353,29 @@ static void encode_plane(FFV1Context *s, uint8_t *src, int w, int h, int stride,
PlaneContext
*
const
p
=
&
s
->
plane
[
plane_index
];
CABACContext
*
const
c
=
&
s
->
c
;
int
x
,
y
;
uint8_t
pred_diff_buffer
[
4
][
w
+
6
];
//FIXME rema,e
uint8_t
*
pred_diff
[
4
]
=
{
pred_diff_buffer
[
0
]
+
3
,
pred_diff_buffer
[
1
]
+
3
,
pred_diff_buffer
[
2
]
+
3
,
pred_diff_buffer
[
3
]
+
3
};
uint8_t
sample_buffer
[
2
][
w
+
6
];
uint8_t
*
sample
[
2
]
=
{
sample_buffer
[
0
]
+
3
,
sample_buffer
[
1
]
+
3
};
int
run_index
=
0
;
memset
(
pred_diff_buffer
,
0
,
sizeof
(
pred_diff
_buffer
));
memset
(
sample_buffer
,
0
,
sizeof
(
sample
_buffer
));
for
(
y
=
0
;
y
<
h
;
y
++
){
uint8_t
*
temp
=
pred_diff
[
0
];
//FIXME try a normal buffer
uint8_t
*
temp
=
sample
[
0
];
//FIXME try a normal buffer
int
run_count
=
0
;
int
run_mode
=
0
;
pred_diff
[
0
]
=
pred_diff
[
1
];
pred_diff
[
1
]
=
pred_diff
[
2
];
pred_diff
[
2
]
=
pred_diff
[
3
];
pred_diff
[
3
]
=
temp
;
sample
[
0
]
=
sample
[
1
];
sample
[
1
]
=
temp
;
pred_diff
[
3
][
-
1
]
=
pred_diff
[
2
][
0
];
pred_diff
[
2
][
w
]
=
pred_diff
[
2
][
w
-
1
];
sample
[
1
][
-
1
]
=
sample
[
0
][
0
];
sample
[
0
][
w
]
=
sample
[
0
][
w
-
1
];
for
(
x
=
0
;
x
<
w
;
x
++
){
uint8_t
*
temp_src
=
src
+
x
+
stride
*
y
;
int
diff
,
context
;
context
=
get_context
(
s
,
pred_diff
[
3
]
+
x
,
pred_diff
[
2
]
+
x
,
pred_diff
[
1
]
+
x
);
diff
=
temp_src
[
0
]
-
predict
(
pred_diff
[
3
]
+
x
,
pred_diff
[
2
]
+
x
);
context
=
get_context
(
s
,
sample
[
1
]
+
x
,
sample
[
0
]
+
x
,
sample
[
1
]
+
x
);
diff
=
temp_src
[
0
]
-
predict
(
sample
[
1
]
+
x
,
sample
[
0
]
+
x
);
if
(
context
<
0
){
context
=
-
context
;
...
...
@@ -416,7 +414,7 @@ static void encode_plane(FFV1Context *s, uint8_t *src, int w, int h, int stride,
put_vlc_symbol
(
&
s
->
pb
,
&
p
->
vlc_state
[
context
],
diff
);
}
pred_diff
[
3
][
x
]
=
temp_src
[
0
];
sample
[
1
][
x
]
=
temp_src
[
0
];
}
if
(
run_mode
){
while
(
run_count
>=
1
<<
log2_run
[
run_index
]){
...
...
@@ -645,30 +643,28 @@ static void decode_plane(FFV1Context *s, uint8_t *src, int w, int h, int stride,
PlaneContext
*
const
p
=
&
s
->
plane
[
plane_index
];
CABACContext
*
const
c
=
&
s
->
c
;
int
x
,
y
;
uint8_t
pred_diff_buffer
[
4
][
w
+
6
];
uint8_t
*
pred_diff
[
4
]
=
{
pred_diff_buffer
[
0
]
+
3
,
pred_diff_buffer
[
1
]
+
3
,
pred_diff_buffer
[
2
]
+
3
,
pred_diff_buffer
[
3
]
+
3
};
uint8_t
sample_buffer
[
2
][
w
+
6
];
uint8_t
*
sample
[
2
]
=
{
sample_buffer
[
0
]
+
3
,
sample_buffer
[
1
]
+
3
};
int
run_index
=
0
;
memset
(
pred_diff_buffer
,
0
,
sizeof
(
pred_diff
_buffer
));
memset
(
sample_buffer
,
0
,
sizeof
(
sample
_buffer
));
for
(
y
=
0
;
y
<
h
;
y
++
){
uint8_t
*
temp
=
pred_diff
[
0
];
//FIXME try a normal buffer
uint8_t
*
temp
=
sample
[
0
];
//FIXME try a normal buffer
int
run_count
=
0
;
int
run_mode
=
0
;
pred_diff
[
0
]
=
pred_diff
[
1
];
pred_diff
[
1
]
=
pred_diff
[
2
];
pred_diff
[
2
]
=
pred_diff
[
3
];
pred_diff
[
3
]
=
temp
;
sample
[
0
]
=
sample
[
1
];
sample
[
1
]
=
temp
;
pred_diff
[
3
][
-
1
]
=
pred_diff
[
2
][
0
];
pred_diff
[
2
][
w
]
=
pred_diff
[
2
][
w
-
1
];
sample
[
1
][
-
1
]
=
sample
[
0
][
0
];
sample
[
0
][
w
]
=
sample
[
0
][
w
-
1
];
for
(
x
=
0
;
x
<
w
;
x
++
){
uint8_t
*
temp_src
=
src
+
x
+
stride
*
y
;
int
diff
,
context
,
sign
;
context
=
get_context
(
s
,
pred_diff
[
3
]
+
x
,
pred_diff
[
2
]
+
x
,
pred_diff
[
1
]
+
x
);
context
=
get_context
(
s
,
sample
[
1
]
+
x
,
sample
[
0
]
+
x
,
sample
[
1
]
+
x
);
if
(
context
<
0
){
context
=
-
context
;
sign
=
1
;
...
...
@@ -709,8 +705,8 @@ static void decode_plane(FFV1Context *s, uint8_t *src, int w, int h, int stride,
if
(
sign
)
diff
=
(
int8_t
)(
-
diff
);
//FIXME remove cast
pred_diff
[
3
][
x
]
=
temp_src
[
0
]
=
predict
(
pred_diff
[
3
]
+
x
,
pred_diff
[
2
]
+
x
)
+
diff
;
sample
[
1
][
x
]
=
temp_src
[
0
]
=
predict
(
sample
[
1
]
+
x
,
sample
[
0
]
+
x
)
+
diff
;
assert
(
diff
>=
-
128
&&
diff
<=
127
);
}
...
...
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