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
43769d72
Commit
43769d72
authored
Apr 07, 2007
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shorter variable names
Originally committed as revision 8671 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
bbbd7757
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
20 deletions
+20
-20
bethsoftvideo.c
libavcodec/bethsoftvideo.c
+20
-20
No files found.
libavcodec/bethsoftvideo.c
View file @
43769d72
...
@@ -62,18 +62,18 @@ static int bethsoftvid_decode_frame(AVCodecContext *avctx,
...
@@ -62,18 +62,18 @@ static int bethsoftvid_decode_frame(AVCodecContext *avctx,
{
{
BethsoftvidContext
*
vid
=
avctx
->
priv_data
;
BethsoftvidContext
*
vid
=
avctx
->
priv_data
;
char
block_type
;
char
block_type
;
uint8_t
*
d
estination
;
uint8_t
*
d
st
;
uint8_t
*
frame_end
;
uint8_t
*
frame_end
;
int
line_
remaining
=
avctx
->
width
;
// number of bytes remaining on a line
int
remaining
=
avctx
->
width
;
// number of bytes remaining on a line
const
int
wrap_to_next_line
=
vid
->
frame
.
linesize
[
0
]
-
avctx
->
width
;
const
int
wrap_to_next_line
=
vid
->
frame
.
linesize
[
0
]
-
avctx
->
width
;
int
rle_num_bytes
;
int
code
;
int
yoffset
;
int
yoffset
;
if
(
avctx
->
reget_buffer
(
avctx
,
&
vid
->
frame
))
{
if
(
avctx
->
reget_buffer
(
avctx
,
&
vid
->
frame
))
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"reget_buffer() failed
\n
"
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"reget_buffer() failed
\n
"
);
return
-
1
;
return
-
1
;
}
}
d
estination
=
vid
->
frame
.
data
[
0
];
d
st
=
vid
->
frame
.
data
[
0
];
frame_end
=
vid
->
frame
.
data
[
0
]
+
vid
->
frame
.
linesize
[
0
]
*
avctx
->
height
;
frame_end
=
vid
->
frame
.
data
[
0
]
+
vid
->
frame
.
linesize
[
0
]
*
avctx
->
height
;
switch
(
block_type
=
*
buf
++
){
switch
(
block_type
=
*
buf
++
){
...
@@ -84,33 +84,33 @@ static int bethsoftvid_decode_frame(AVCodecContext *avctx,
...
@@ -84,33 +84,33 @@ static int bethsoftvid_decode_frame(AVCodecContext *avctx,
yoffset
=
bytestream_get_le16
(
&
buf
);
yoffset
=
bytestream_get_le16
(
&
buf
);
if
(
yoffset
>=
avctx
->
height
)
if
(
yoffset
>=
avctx
->
height
)
return
-
1
;
return
-
1
;
d
estination
+=
vid
->
frame
.
linesize
[
0
]
*
yoffset
;
d
st
+=
vid
->
frame
.
linesize
[
0
]
*
yoffset
;
}
}
// main code
// main code
while
((
rle_num_bytes
=
*
buf
++
)){
while
((
code
=
*
buf
++
)){
int
length
=
rle_num_bytes
&
0x7f
;
int
length
=
code
&
0x7f
;
// copy any bytes starting at the current position, and ending at the frame width
// copy any bytes starting at the current position, and ending at the frame width
while
(
length
>
line_
remaining
){
while
(
length
>
remaining
){
if
(
rle_num_bytes
<
0x80
)
if
(
code
<
0x80
)
bytestream_get_buffer
(
&
buf
,
d
estination
,
line_
remaining
);
bytestream_get_buffer
(
&
buf
,
d
st
,
remaining
);
else
if
(
block_type
==
VIDEO_I_FRAME
)
else
if
(
block_type
==
VIDEO_I_FRAME
)
memset
(
d
estination
,
buf
[
0
],
line_
remaining
);
memset
(
d
st
,
buf
[
0
],
remaining
);
length
-=
line_
remaining
;
// decrement the number of bytes to be copied
length
-=
remaining
;
// decrement the number of bytes to be copied
d
estination
+=
line_
remaining
+
wrap_to_next_line
;
// skip over extra bytes at end of frame
d
st
+=
remaining
+
wrap_to_next_line
;
// skip over extra bytes at end of frame
line_
remaining
=
avctx
->
width
;
remaining
=
avctx
->
width
;
if
(
d
estination
==
frame_end
)
if
(
d
st
==
frame_end
)
goto
end
;
goto
end
;
}
}
// copy any remaining bytes after / if line overflows
// copy any remaining bytes after / if line overflows
if
(
rle_num_bytes
<
0x80
)
if
(
code
<
0x80
)
bytestream_get_buffer
(
&
buf
,
d
estination
,
length
);
bytestream_get_buffer
(
&
buf
,
d
st
,
length
);
else
if
(
block_type
==
VIDEO_I_FRAME
)
else
if
(
block_type
==
VIDEO_I_FRAME
)
memset
(
d
estination
,
*
buf
++
,
length
);
memset
(
d
st
,
*
buf
++
,
length
);
line_
remaining
-=
length
;
remaining
-=
length
;
d
estination
+=
length
;
d
st
+=
length
;
}
}
end:
end:
...
...
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