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
39a2d328
Commit
39a2d328
authored
Mar 04, 2016
by
Luca Barbato
Committed by
Vittorio Giovara
Mar 05, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpegvideo: Refactor emulated_edge_mc calls
parent
02423513
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
42 deletions
+36
-42
mpegvideo_motion.c
libavcodec/mpegvideo_motion.c
+36
-42
No files found.
libavcodec/mpegvideo_motion.c
View file @
39a2d328
...
...
@@ -226,6 +226,38 @@ static inline int hpel_motion(MpegEncContext *s,
return
emu
;
}
static
av_always_inline
void
emulated_edge_mc
(
MpegEncContext
*
s
,
int
src_x
,
int
src_y
,
int
uvsrc_x
,
int
uvsrc_y
,
int
field_based
,
uint8_t
**
ptr_y
,
uint8_t
**
ptr_cb
,
uint8_t
**
ptr_cr
)
{
s
->
vdsp
.
emulated_edge_mc
(
s
->
sc
.
edge_emu_buffer
,
*
ptr_y
,
s
->
linesize
,
s
->
linesize
,
17
,
17
+
field_based
,
src_x
,
src_y
*
(
1
<<
field_based
),
s
->
h_edge_pos
,
s
->
v_edge_pos
);
*
ptr_y
=
s
->
sc
.
edge_emu_buffer
;
if
(
!
CONFIG_GRAY
||
!
(
s
->
avctx
->
flags
&
AV_CODEC_FLAG_GRAY
))
{
uint8_t
*
uvbuf
=
s
->
sc
.
edge_emu_buffer
+
18
*
s
->
linesize
;
s
->
vdsp
.
emulated_edge_mc
(
uvbuf
,
*
ptr_cb
,
s
->
uvlinesize
,
s
->
uvlinesize
,
9
,
9
+
field_based
,
uvsrc_x
,
uvsrc_y
*
(
1
<<
field_based
),
s
->
h_edge_pos
>>
1
,
s
->
v_edge_pos
>>
1
);
s
->
vdsp
.
emulated_edge_mc
(
uvbuf
+
16
,
*
ptr_cr
,
s
->
uvlinesize
,
s
->
uvlinesize
,
9
,
9
+
field_based
,
uvsrc_x
,
uvsrc_y
*
(
1
<<
field_based
),
s
->
h_edge_pos
>>
1
,
s
->
v_edge_pos
>>
1
);
*
ptr_cb
=
uvbuf
;
*
ptr_cr
=
uvbuf
+
16
;
}
}
static
av_always_inline
void
mpeg_motion_internal
(
MpegEncContext
*
s
,
uint8_t
*
dest_y
,
...
...
@@ -318,27 +350,8 @@ void mpeg_motion_internal(MpegEncContext *s,
src_y
);
return
;
}
s
->
vdsp
.
emulated_edge_mc
(
s
->
sc
.
edge_emu_buffer
,
ptr_y
,
s
->
linesize
,
s
->
linesize
,
17
,
17
+
field_based
,
src_x
,
src_y
*
(
1
<<
field_based
),
s
->
h_edge_pos
,
s
->
v_edge_pos
);
ptr_y
=
s
->
sc
.
edge_emu_buffer
;
if
(
!
CONFIG_GRAY
||
!
(
s
->
avctx
->
flags
&
AV_CODEC_FLAG_GRAY
))
{
uint8_t
*
uvbuf
=
s
->
sc
.
edge_emu_buffer
+
18
*
s
->
linesize
;
s
->
vdsp
.
emulated_edge_mc
(
uvbuf
,
ptr_cb
,
s
->
uvlinesize
,
s
->
uvlinesize
,
9
,
9
+
field_based
,
uvsrc_x
,
uvsrc_y
*
(
1
<<
field_based
),
s
->
h_edge_pos
>>
1
,
s
->
v_edge_pos
>>
1
);
s
->
vdsp
.
emulated_edge_mc
(
uvbuf
+
16
,
ptr_cr
,
s
->
uvlinesize
,
s
->
uvlinesize
,
9
,
9
+
field_based
,
uvsrc_x
,
uvsrc_y
*
(
1
<<
field_based
),
s
->
h_edge_pos
>>
1
,
s
->
v_edge_pos
>>
1
);
ptr_cb
=
uvbuf
;
ptr_cr
=
uvbuf
+
16
;
}
emulated_edge_mc
(
s
,
src_x
,
src_y
,
uvsrc_x
,
uvsrc_y
,
field_based
,
&
ptr_y
,
&
ptr_cb
,
&
ptr_cr
);
}
/* FIXME use this for field pix too instead of the obnoxious hack which
...
...
@@ -539,27 +552,8 @@ static inline void qpel_motion(MpegEncContext *s,
if
((
unsigned
)
src_x
>
FFMAX
(
s
->
h_edge_pos
-
(
motion_x
&
3
)
-
16
,
0
)
||
(
unsigned
)
src_y
>
FFMAX
(
v_edge_pos
-
(
motion_y
&
3
)
-
h
,
0
))
{
s
->
vdsp
.
emulated_edge_mc
(
s
->
sc
.
edge_emu_buffer
,
ptr_y
,
s
->
linesize
,
s
->
linesize
,
17
,
17
+
field_based
,
src_x
,
src_y
*
(
1
<<
field_based
),
s
->
h_edge_pos
,
s
->
v_edge_pos
);
ptr_y
=
s
->
sc
.
edge_emu_buffer
;
if
(
!
CONFIG_GRAY
||
!
(
s
->
avctx
->
flags
&
AV_CODEC_FLAG_GRAY
))
{
uint8_t
*
uvbuf
=
s
->
sc
.
edge_emu_buffer
+
18
*
s
->
linesize
;
s
->
vdsp
.
emulated_edge_mc
(
uvbuf
,
ptr_cb
,
s
->
uvlinesize
,
s
->
uvlinesize
,
9
,
9
+
field_based
,
uvsrc_x
,
uvsrc_y
*
(
1
<<
field_based
),
s
->
h_edge_pos
>>
1
,
s
->
v_edge_pos
>>
1
);
s
->
vdsp
.
emulated_edge_mc
(
uvbuf
+
16
,
ptr_cr
,
s
->
uvlinesize
,
s
->
uvlinesize
,
9
,
9
+
field_based
,
uvsrc_x
,
uvsrc_y
*
(
1
<<
field_based
),
s
->
h_edge_pos
>>
1
,
s
->
v_edge_pos
>>
1
);
ptr_cb
=
uvbuf
;
ptr_cr
=
uvbuf
+
16
;
}
emulated_edge_mc
(
s
,
src_x
,
src_y
,
uvsrc_x
,
uvsrc_y
,
field_based
,
&
ptr_y
,
&
ptr_cb
,
&
ptr_cr
);
}
if
(
!
field_based
)
...
...
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