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
c8a4ebbf
Commit
c8a4ebbf
authored
Feb 29, 2004
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplify MPV_motion()
Originally committed as revision 2828 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
5ba326b5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
72 deletions
+38
-72
mpegvideo.c
libavcodec/mpegvideo.c
+38
-72
No files found.
libavcodec/mpegvideo.c
View file @
c8a4ebbf
...
...
@@ -2875,16 +2875,12 @@ static inline void MPV_motion(MpegEncContext *s,
case
MV_TYPE_FIELD
:
if
(
s
->
picture_structure
==
PICT_FRAME
)
{
if
(
s
->
quarter_sample
){
/* top field */
qpel_motion
(
s
,
dest_y
,
dest_cb
,
dest_cr
,
1
,
0
,
s
->
field_select
[
dir
][
0
],
ref_picture
,
pix_op
,
qpix_op
,
s
->
mv
[
dir
][
0
][
0
],
s
->
mv
[
dir
][
0
][
1
],
8
);
/* bottom field */
qpel_motion
(
s
,
dest_y
,
dest_cb
,
dest_cr
,
1
,
1
,
s
->
field_select
[
dir
][
1
],
ref_picture
,
pix_op
,
qpix_op
,
s
->
mv
[
dir
][
1
][
0
],
s
->
mv
[
dir
][
1
][
1
],
8
);
for
(
i
=
0
;
i
<
2
;
i
++
){
qpel_motion
(
s
,
dest_y
,
dest_cb
,
dest_cr
,
1
,
i
,
s
->
field_select
[
dir
][
i
],
ref_picture
,
pix_op
,
qpix_op
,
s
->
mv
[
dir
][
i
][
0
],
s
->
mv
[
dir
][
i
][
1
],
8
);
}
}
else
{
/* top field */
mpeg_motion
(
s
,
dest_y
,
dest_cb
,
dest_cr
,
...
...
@@ -2908,83 +2904,53 @@ static inline void MPV_motion(MpegEncContext *s,
s
->
mv
[
dir
][
0
][
0
],
s
->
mv
[
dir
][
0
][
1
],
16
);
}
break
;
case
MV_TYPE_16X8
:{
uint8_t
**
ref2picture
;
case
MV_TYPE_16X8
:
for
(
i
=
0
;
i
<
2
;
i
++
){
uint8_t
**
ref2picture
;
if
(
s
->
picture_structure
==
s
->
field_select
[
dir
][
0
]
+
1
||
s
->
pict_type
==
B_TYPE
||
s
->
first_field
){
if
(
s
->
picture_structure
==
s
->
field_select
[
dir
][
i
]
+
1
||
s
->
pict_type
==
B_TYPE
||
s
->
first_field
){
ref2picture
=
ref_picture
;
}
else
{
ref2picture
=
s
->
current_picture_ptr
->
data
;
}
mpeg_motion
(
s
,
dest_y
,
dest_cb
,
dest_cr
,
0
,
0
,
s
->
field_select
[
dir
][
0
],
0
,
0
,
s
->
field_select
[
dir
][
i
],
ref2picture
,
pix_op
,
s
->
mv
[
dir
][
0
][
0
],
s
->
mv
[
dir
][
0
][
1
],
8
);
if
(
s
->
picture_structure
==
s
->
field_select
[
dir
][
1
]
+
1
||
s
->
pict_type
==
B_TYPE
||
s
->
first_field
){
ref2picture
=
ref_picture
;
}
else
{
ref2picture
=
s
->
current_picture_ptr
->
data
;
}
// I know it is ugly but this is the only way to fool emu_edge without rewrite mpeg_motion
mpeg_motion
(
s
,
dest_y
+
16
*
s
->
linesize
,
dest_cb
+
8
*
s
->
uvlinesize
,
dest_cr
+
8
*
s
->
uvlinesize
,
0
,
0
,
s
->
field_select
[
dir
][
1
],
ref2picture
,
pix_op
,
s
->
mv
[
dir
][
1
][
0
],
s
->
mv
[
dir
][
1
][
1
]
+
16
,
8
);
}
s
->
mv
[
dir
][
i
][
0
],
s
->
mv
[
dir
][
i
][
1
]
+
16
*
i
,
8
);
dest_y
+=
16
*
s
->
linesize
;
dest_cb
+=
8
*
s
->
uvlinesize
;
dest_cr
+=
8
*
s
->
uvlinesize
;
}
break
;
case
MV_TYPE_DMV
:
pix_op
=
s
->
dsp
.
put_pixels_tab
;
if
(
s
->
picture_structure
==
PICT_FRAME
){
//put top field from top field
mpeg_motion
(
s
,
dest_y
,
dest_cb
,
dest_cr
,
1
,
0
,
0
,
ref_picture
,
pix_op
,
s
->
mv
[
dir
][
0
][
0
],
s
->
mv
[
dir
][
0
][
1
],
8
);
//put bottom field from bottom field
mpeg_motion
(
s
,
dest_y
,
dest_cb
,
dest_cr
,
1
,
1
,
1
,
ref_picture
,
pix_op
,
s
->
mv
[
dir
][
0
][
0
],
s
->
mv
[
dir
][
0
][
1
],
8
);
pix_op
=
s
->
dsp
.
avg_pixels_tab
;
//avg top field from bottom field
mpeg_motion
(
s
,
dest_y
,
dest_cb
,
dest_cr
,
1
,
0
,
1
,
ref_picture
,
pix_op
,
s
->
mv
[
dir
][
2
][
0
],
s
->
mv
[
dir
][
2
][
1
],
8
);
//avg bottom field from top field
mpeg_motion
(
s
,
dest_y
,
dest_cb
,
dest_cr
,
1
,
1
,
0
,
ref_picture
,
pix_op
,
s
->
mv
[
dir
][
3
][
0
],
s
->
mv
[
dir
][
3
][
1
],
8
);
for
(
i
=
0
;
i
<
2
;
i
++
){
int
j
;
for
(
j
=
0
;
j
<
2
;
j
++
){
mpeg_motion
(
s
,
dest_y
,
dest_cb
,
dest_cr
,
1
,
j
,
j
^
i
,
ref_picture
,
pix_op
,
s
->
mv
[
dir
][
2
*
i
+
j
][
0
],
s
->
mv
[
dir
][
2
*
i
+
j
][
1
],
8
);
}
pix_op
=
s
->
dsp
.
avg_pixels_tab
;
}
}
else
{
//put field from the same parity
//same parity is never in the same frame
mpeg_motion
(
s
,
dest_y
,
dest_cb
,
dest_cr
,
0
,
0
,
s
->
picture_structure
==
PICT_BOTTOM_FIELD
,
ref_picture
,
pix_op
,
s
->
mv
[
dir
][
0
][
0
],
s
->
mv
[
dir
][
0
][
1
],
16
);
for
(
i
=
0
;
i
<
2
;
i
++
){
mpeg_motion
(
s
,
dest_y
,
dest_cb
,
dest_cr
,
0
,
0
,
s
->
picture_structure
!=
i
+
1
,
ref_picture
,
pix_op
,
s
->
mv
[
dir
][
2
*
i
][
0
],
s
->
mv
[
dir
][
2
*
i
][
1
],
16
);
// after put we make avg of the same block
pix_op
=
s
->
dsp
.
avg_pixels_tab
;
// after put we make avg of the same block
pix_op
=
s
->
dsp
.
avg_pixels_tab
;
//opposite parity is always in the same frame if this is second field
if
(
!
s
->
first_field
){
ref_picture
=
s
->
current_picture_ptr
->
data
;
//opposite parity is always in the same frame if this is second field
if
(
!
s
->
first_field
){
ref_picture
=
s
->
current_picture_ptr
->
data
;
}
}
//avg field from the opposite parity
mpeg_motion
(
s
,
dest_y
,
dest_cb
,
dest_cr
,
0
,
0
,
s
->
picture_structure
!=
PICT_BOTTOM_FIELD
,
ref_picture
,
pix_op
,
s
->
mv
[
dir
][
2
][
0
],
s
->
mv
[
dir
][
2
][
1
],
16
);
}
break
;
default
:
assert
(
0
);
...
...
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