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
95587859
Commit
95587859
authored
Oct 13, 2013
by
Luca Barbato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpegvideo: Move obmc in a separate function
parent
a90905db
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
88 additions
and
76 deletions
+88
-76
mpegvideo_motion.c
libavcodec/mpegvideo_motion.c
+88
-76
No files found.
libavcodec/mpegvideo_motion.c
View file @
95587859
...
...
@@ -660,43 +660,21 @@ static inline void prefetch_motion(MpegEncContext *s, uint8_t **pix, int dir)
s
->
vdsp
.
prefetch
(
pix
[
1
]
+
off
,
pix
[
2
]
-
pix
[
1
],
2
);
}
/**
* motion compensation of a single macroblock
* @param s context
* @param dest_y luma destination pointer
* @param dest_cb chroma cb/u destination pointer
* @param dest_cr chroma cr/v destination pointer
* @param dir direction (0->forward, 1->backward)
* @param ref_picture array[3] of pointers to the 3 planes of the reference picture
* @param pix_op halfpel motion compensation function (average or put normally)
* @param qpix_op qpel motion compensation function (average or put normally)
* the motion vectors are taken from s->mv and the MV type from s->mv_type
*/
static
av_always_inline
void
MPV_motion_internal
(
MpegEncContext
*
s
,
static
inline
void
apply_obmc
(
MpegEncContext
*
s
,
uint8_t
*
dest_y
,
uint8_t
*
dest_cb
,
uint8_t
*
dest_cr
,
int
dir
,
uint8_t
**
ref_picture
,
op_pixels_func
(
*
pix_op
)[
4
],
qpel_mc_func
(
*
qpix_op
)[
16
],
int
is_mpeg12
)
op_pixels_func
(
*
pix_op
)[
4
])
{
int
dxy
,
mx
,
my
,
src_x
,
src_y
,
motion_x
,
motion_y
;
int
mb_x
,
mb_y
,
i
;
uint8_t
*
ptr
,
*
dest
;
mb_x
=
s
->
mb_x
;
mb_y
=
s
->
mb_y
;
prefetch_motion
(
s
,
ref_picture
,
dir
);
if
(
!
is_mpeg12
&&
s
->
obmc
&&
s
->
pict_type
!=
AV_PICTURE_TYPE_B
)
{
LOCAL_ALIGNED_8
(
int16_t
,
mv_cache
,
[
4
],
[
4
][
2
]);
Picture
*
cur_frame
=
&
s
->
current_picture
;
const
int
xy
=
s
->
mb_x
+
s
->
mb_y
*
s
->
mb_stride
;
int
mb_x
=
s
->
mb_x
;
int
mb_y
=
s
->
mb_y
;
const
int
xy
=
mb_x
+
mb_y
*
s
->
mb_stride
;
const
int
mot_stride
=
s
->
b8_stride
;
const
int
mot_xy
=
mb_x
*
2
+
mb_y
*
2
*
mot_stride
;
int
mx
,
my
,
i
;
assert
(
!
s
->
mb_skipped
);
...
...
@@ -767,7 +745,41 @@ static av_always_inline void MPV_motion_internal(MpegEncContext *s,
chroma_4mv_motion
(
s
,
dest_cb
,
dest_cr
,
ref_picture
,
pix_op
[
1
],
mx
,
my
);
}
/**
* motion compensation of a single macroblock
* @param s context
* @param dest_y luma destination pointer
* @param dest_cb chroma cb/u destination pointer
* @param dest_cr chroma cr/v destination pointer
* @param dir direction (0->forward, 1->backward)
* @param ref_picture array[3] of pointers to the 3 planes of the reference picture
* @param pix_op halfpel motion compensation function (average or put normally)
* @param qpix_op qpel motion compensation function (average or put normally)
* the motion vectors are taken from s->mv and the MV type from s->mv_type
*/
static
av_always_inline
void
MPV_motion_internal
(
MpegEncContext
*
s
,
uint8_t
*
dest_y
,
uint8_t
*
dest_cb
,
uint8_t
*
dest_cr
,
int
dir
,
uint8_t
**
ref_picture
,
op_pixels_func
(
*
pix_op
)[
4
],
qpel_mc_func
(
*
qpix_op
)[
16
],
int
is_mpeg12
)
{
int
dxy
,
mx
,
my
,
src_x
,
src_y
,
motion_x
,
motion_y
;
int
mb_x
,
mb_y
,
i
;
uint8_t
*
ptr
,
*
dest
;
mb_x
=
s
->
mb_x
;
mb_y
=
s
->
mb_y
;
prefetch_motion
(
s
,
ref_picture
,
dir
);
if
(
!
is_mpeg12
&&
s
->
obmc
&&
s
->
pict_type
!=
AV_PICTURE_TYPE_B
)
{
apply_obmc
(
s
,
dest_y
,
dest_cb
,
dest_cr
,
ref_picture
,
pix_op
);
return
;
}
...
...
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