Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
43769d72
Commit
43769d72
authored
17 years ago
by
Michael Niedermayer
Browse files
Options
Downloads
Patches
Plain Diff
shorter variable names
Originally committed as revision 8671 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
bbbd7757
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavcodec/bethsoftvideo.c
+20
-20
20 additions, 20 deletions
libavcodec/bethsoftvideo.c
with
20 additions
and
20 deletions
libavcodec/bethsoftvideo.c
+
20
−
20
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
e
st
ination
;
uint8_t
*
dst
;
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
e
st
ination
=
vid
->
frame
.
data
[
0
];
dst
=
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
e
st
ination
+=
vid
->
frame
.
linesize
[
0
]
*
yoffset
;
dst
+=
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
e
st
ination
,
line_
remaining
);
bytestream_get_buffer
(
&
buf
,
dst
,
remaining
);
else
if
(
block_type
==
VIDEO_I_FRAME
)
else
if
(
block_type
==
VIDEO_I_FRAME
)
memset
(
d
e
st
ination
,
buf
[
0
],
line_
remaining
);
memset
(
dst
,
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
e
st
ination
+=
line_
remaining
+
wrap_to_next_line
;
// skip over extra bytes at end of frame
dst
+=
remaining
+
wrap_to_next_line
;
// skip over extra bytes at end of frame
line_
remaining
=
avctx
->
width
;
remaining
=
avctx
->
width
;
if
(
d
e
st
ination
==
frame_end
)
if
(
dst
==
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
e
st
ination
,
length
);
bytestream_get_buffer
(
&
buf
,
dst
,
length
);
else
if
(
block_type
==
VIDEO_I_FRAME
)
else
if
(
block_type
==
VIDEO_I_FRAME
)
memset
(
d
e
st
ination
,
*
buf
++
,
length
);
memset
(
dst
,
*
buf
++
,
length
);
line_
remaining
-=
length
;
remaining
-=
length
;
d
e
st
ination
+=
length
;
dst
+=
length
;
}
}
end:
end:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment