Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
GSoC
GSoC2018
macOS
vlc
Commits
41b390e2
Commit
41b390e2
authored
Mar 09, 2018
by
Thomas Guillem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chroma: i420_nv12: refactor
parent
52e2c531
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
24 deletions
+20
-24
modules/video_chroma/i420_nv12.c
modules/video_chroma/i420_nv12.c
+20
-24
No files found.
modules/video_chroma/i420_nv12.c
View file @
41b390e2
...
...
@@ -39,29 +39,16 @@ struct filter_sys_t
copy_cache_t
cache
;
};
static
void
I420_YUV
(
filter_sys_t
*
p_sys
,
picture_t
*
p_src
,
picture_t
*
p_dst
,
bool
invertUV
)
{
p_dst
->
format
.
i_x_offset
=
p_src
->
format
.
i_x_offset
;
p_dst
->
format
.
i_y_offset
=
p_src
->
format
.
i_y_offset
;
const
size_t
u_plane
=
invertUV
?
V_PLANE
:
U_PLANE
;
const
size_t
v_plane
=
invertUV
?
U_PLANE
:
V_PLANE
;
const
size_t
pitch
[
3
]
=
{
p_src
->
p
[
Y_PLANE
].
i_pitch
,
p_src
->
p
[
u_plane
].
i_pitch
,
p_src
->
p
[
v_plane
].
i_pitch
,
};
const
uint8_t
*
plane
[
3
]
=
{
(
uint8_t
*
)
p_src
->
p
[
Y_PLANE
].
p_pixels
,
(
uint8_t
*
)
p_src
->
p
[
u_plane
].
p_pixels
,
(
uint8_t
*
)
p_src
->
p
[
v_plane
].
p_pixels
,
};
#define GET_PITCHES( pic ) { \
pic->p[Y_PLANE].i_pitch, \
pic->p[U_PLANE].i_pitch, \
pic->p[V_PLANE].i_pitch \
}
Copy420_P_to_SP
(
p_dst
,
plane
,
pitch
,
p_src
->
format
.
i_y_offset
+
p_src
->
format
.
i_visible_height
,
&
p_sys
->
cache
);
#define GET_PLANES( pic ) { \
pic->p[Y_PLANE].p_pixels, \
pic->p[U_PLANE].p_pixels, \
pic->p[V_PLANE].p_pixels \
}
/*****************************************************************************
...
...
@@ -70,7 +57,15 @@ static void I420_YUV( filter_sys_t *p_sys, picture_t *p_src, picture_t *p_dst, b
static
void
I420_NV12
(
filter_t
*
p_filter
,
picture_t
*
p_src
,
picture_t
*
p_dst
)
{
I420_YUV
(
p_filter
->
p_sys
,
p_src
,
p_dst
,
false
);
filter_sys_t
*
p_sys
=
p_filter
->
p_sys
;
p_dst
->
format
.
i_x_offset
=
p_src
->
format
.
i_x_offset
;
p_dst
->
format
.
i_y_offset
=
p_src
->
format
.
i_y_offset
;
const
size_t
pitches
[]
=
GET_PITCHES
(
p_src
);
const
uint8_t
*
planes
[]
=
GET_PLANES
(
p_src
);
Copy420_P_to_SP
(
p_dst
,
planes
,
pitches
,
p_src
->
format
.
i_y_offset
+
p_src
->
format
.
i_visible_height
,
&
p_sys
->
cache
);
}
/*****************************************************************************
...
...
@@ -79,7 +74,8 @@ static void I420_NV12( filter_t *p_filter, picture_t *p_src,
static
void
YV12_NV12
(
filter_t
*
p_filter
,
picture_t
*
p_src
,
picture_t
*
p_dst
)
{
I420_YUV
(
p_filter
->
p_sys
,
p_src
,
p_dst
,
true
);
picture_SwapUV
(
p_src
);
I420_NV12
(
p_filter
,
p_src
,
p_dst
);
}
/* Following functions are local */
...
...
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