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
508abaca
Commit
508abaca
authored
Aug 05, 2002
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
4mv + bframe decoding bugfix
Originally committed as revision 843 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
f255af5d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
4 deletions
+25
-4
h263.c
libavcodec/h263.c
+16
-3
mpegvideo.c
libavcodec/mpegvideo.c
+8
-1
mpegvideo.h
libavcodec/mpegvideo.h
+1
-0
No files found.
libavcodec/h263.c
View file @
508abaca
...
...
@@ -2643,14 +2643,12 @@ int h263_decode_mb(MpegEncContext *s,
case
0
:
/* direct */
mx
=
h263_decode_motion
(
s
,
0
,
1
);
my
=
h263_decode_motion
(
s
,
0
,
1
);
PRINT_MB_TYPE
(
"S"
);
case
4
:
/* direct with mx=my=0 */
s
->
mv_dir
=
MV_DIR_FORWARD
|
MV_DIR_BACKWARD
|
MV_DIRECT
;
xy
=
s
->
block_index
[
0
];
time_pp
=
s
->
pp_time
;
time_pb
=
time_pp
-
s
->
bp_time
;
//if(time_pp>3000 )printf("%d %d ", time_pp, time_pb);
//FIXME 4MV
//FIXME avoid divides
s
->
mv
[
0
][
0
][
0
]
=
s
->
motion_val
[
xy
][
0
]
*
time_pb
/
time_pp
+
mx
;
s
->
mv
[
0
][
0
][
1
]
=
s
->
motion_val
[
xy
][
1
]
*
time_pb
/
time_pp
+
my
;
...
...
@@ -2658,11 +2656,26 @@ int h263_decode_mb(MpegEncContext *s,
:
s
->
motion_val
[
xy
][
0
]
*
(
time_pb
-
time_pp
)
/
time_pp
+
mx
;
s
->
mv
[
1
][
0
][
1
]
=
my
?
s
->
mv
[
0
][
0
][
1
]
-
s
->
motion_val
[
xy
][
1
]
:
s
->
motion_val
[
xy
][
1
]
*
(
time_pb
-
time_pp
)
/
time_pp
+
my
;
if
(
s
->
non_b_mv4_table
[
xy
]){
int
i
;
s
->
mv_type
=
MV_TYPE_8X8
;
for
(
i
=
1
;
i
<
4
;
i
++
){
xy
=
s
->
block_index
[
i
];
s
->
mv
[
0
][
i
][
0
]
=
s
->
motion_val
[
xy
][
0
]
*
time_pb
/
time_pp
+
mx
;
s
->
mv
[
0
][
i
][
1
]
=
s
->
motion_val
[
xy
][
1
]
*
time_pb
/
time_pp
+
my
;
s
->
mv
[
1
][
i
][
0
]
=
mx
?
s
->
mv
[
0
][
i
][
0
]
-
s
->
motion_val
[
xy
][
0
]
:
s
->
motion_val
[
xy
][
0
]
*
(
time_pb
-
time_pp
)
/
time_pp
+
mx
;
s
->
mv
[
1
][
i
][
1
]
=
my
?
s
->
mv
[
0
][
i
][
1
]
-
s
->
motion_val
[
xy
][
1
]
:
s
->
motion_val
[
xy
][
1
]
*
(
time_pb
-
time_pp
)
/
time_pp
+
my
;
}
PRINT_MB_TYPE
(
"4"
);
}
else
{
PRINT_MB_TYPE
(
mb_type
==
4
?
"D"
:
"S"
);
}
/* s->mv[0][0][0] =
s->mv[0][0][1] =
s->mv[1][0][0] =
s->mv[1][0][1] = 1000;*/
if
(
mb_type
==
4
)
PRINT_MB_TYPE
(
"D"
);
break
;
case
1
:
s
->
mv_dir
=
MV_DIR_FORWARD
|
MV_DIR_BACKWARD
;
...
...
libavcodec/mpegvideo.c
View file @
508abaca
...
...
@@ -236,6 +236,9 @@ int MPV_common_init(MpegEncContext *s)
/* MV prediction */
size
=
(
2
*
s
->
mb_width
+
2
)
*
(
2
*
s
->
mb_height
+
2
);
CHECKED_ALLOCZ
(
s
->
motion_val
,
size
*
2
*
sizeof
(
INT16
));
/* 4mv direct mode decoding table */
CHECKED_ALLOCZ
(
s
->
non_b_mv4_table
,
size
*
sizeof
(
UINT8
))
}
if
(
s
->
h263_pred
||
s
->
h263_plus
)
{
...
...
@@ -324,7 +327,8 @@ void MPV_common_end(MpegEncContext *s)
av_freep
(
&
s
->
tex_pb_buffer
);
av_freep
(
&
s
->
pb2_buffer
);
av_freep
(
&
s
->
edge_emu_buffer
);
av_freep
(
&
s
->
non_b_mv4_table
);
for
(
i
=
0
;
i
<
3
;
i
++
)
{
int
j
;
if
(
!
(
s
->
flags
&
CODEC_FLAG_DR1
)){
...
...
@@ -1453,6 +1457,9 @@ void MPV_decode_mb(MpegEncContext *s, DCTELEM block[6][64])
s
->
motion_val
[
xy
+
wrap
][
1
]
=
motion_y
;
s
->
motion_val
[
xy
+
1
+
wrap
][
0
]
=
motion_x
;
s
->
motion_val
[
xy
+
1
+
wrap
][
1
]
=
motion_y
;
s
->
non_b_mv4_table
[
xy
]
=
0
;
}
else
{
/* 8X8 */
s
->
non_b_mv4_table
[
xy
]
=
1
;
}
}
...
...
libavcodec/mpegvideo.h
View file @
508abaca
...
...
@@ -362,6 +362,7 @@ typedef struct MpegEncContext {
uint8_t
*
tex_pb_buffer
;
uint8_t
*
pb2_buffer
;
int
mpeg_quant
;
INT8
*
non_b_mv4_table
;
/* divx specific, used to workaround (many) bugs in divx5 */
int
divx_version
;
...
...
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