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
b37e98c8
Commit
b37e98c8
authored
20 years ago
by
Michael Niedermayer
Browse files
Options
Downloads
Patches
Plain Diff
simplify
Originally committed as revision 3178 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
fdbbf2e0
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/h261.c
+17
-32
17 additions, 32 deletions
libavcodec/h261.c
with
17 additions
and
32 deletions
libavcodec/h261.c
+
17
−
32
View file @
b37e98c8
...
...
@@ -58,7 +58,6 @@ typedef struct H261Context{
void
ff_h261_loop_filter
(
H261Context
*
h
){
MpegEncContext
*
const
s
=
&
h
->
s
;
int
i
;
const
int
linesize
=
s
->
linesize
;
const
int
uvlinesize
=
s
->
uvlinesize
;
uint8_t
*
dest_y
=
s
->
dest
[
0
];
...
...
@@ -229,11 +228,25 @@ static int h261_decode_mb_skipped(H261Context *h,
return
0
;
}
static
int
decode_mv_component
(
GetBitContext
*
gb
,
int
v
){
int
mv_diff
=
get_vlc2
(
gb
,
h261_mv_vlc
.
table
,
H261_MV_VLC_BITS
,
2
);
mv_diff
=
mvmap
[
mv_diff
];
if
(
mv_diff
&&
!
get_bits1
(
gb
))
mv_diff
=
-
mv_diff
;
v
+=
mv_diff
;
if
(
v
<=-
16
)
v
+=
32
;
else
if
(
v
>=
16
)
v
-=
32
;
return
v
;
}
static
int
h261_decode_mb
(
H261Context
*
h
,
DCTELEM
block
[
6
][
64
])
{
MpegEncContext
*
const
s
=
&
h
->
s
;
int
i
,
cbp
,
mv_x_diff
,
mv_y_diff
,
sign
,
xy
;
int
i
,
cbp
,
xy
;
cbp
=
63
;
// Read mba
...
...
@@ -288,36 +301,8 @@ static int h261_decode_mb(H261Context *h,
h
->
current_mv_y
=
0
;
}
mv_x_diff
=
get_vlc2
(
&
s
->
gb
,
h261_mv_vlc
.
table
,
H261_MV_VLC_BITS
,
2
);
mv_x_diff
=
mvmap
[
mv_x_diff
];
if
(
mv_x_diff
!=
0
){
sign
=
get_bits1
(
&
s
->
gb
);
if
(
!
sign
)
mv_x_diff
=
-
mv_x_diff
;
}
mv_y_diff
=
get_vlc2
(
&
s
->
gb
,
h261_mv_vlc
.
table
,
H261_MV_VLC_BITS
,
2
);
mv_y_diff
=
mvmap
[
mv_y_diff
];
if
(
mv_y_diff
!=
0
){
sign
=
get_bits1
(
&
s
->
gb
);
if
(
!
sign
)
mv_y_diff
=
-
mv_y_diff
;
}
//mv's are in the range -15...15
if
((
h
->
current_mv_x
+
mv_x_diff
>
-
16
)
&&
(
h
->
current_mv_x
+
mv_x_diff
<
16
)
)
h
->
current_mv_x
+=
mv_x_diff
;
else
h
->
current_mv_x
+=
(
mv_x_diff
+
(
mv_x_diff
>
0
?
-
32
:
32
));
if
((
h
->
current_mv_y
+
mv_y_diff
>
-
16
)
&&
(
h
->
current_mv_y
+
mv_y_diff
<
16
)
)
h
->
current_mv_y
+=
mv_y_diff
;
else
h
->
current_mv_y
+=
(
mv_y_diff
+
(
mv_y_diff
>
0
?
-
32
:
32
));
h
->
current_mv_x
=
decode_mv_component
(
&
s
->
gb
,
h
->
current_mv_x
);
h
->
current_mv_y
=
decode_mv_component
(
&
s
->
gb
,
h
->
current_mv_y
);
}
// Read cbp
...
...
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