Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
13
Issues
13
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
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
Hide 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
...
@@ -39,29 +39,16 @@ struct filter_sys_t
copy_cache_t
cache
;
copy_cache_t
cache
;
};
};
static
void
I420_YUV
(
filter_sys_t
*
p_sys
,
picture_t
*
p_src
,
picture_t
*
p_dst
,
bool
invertUV
)
#define GET_PITCHES( pic ) { \
{
pic->p[Y_PLANE].i_pitch, \
p_dst
->
format
.
i_x_offset
=
p_src
->
format
.
i_x_offset
;
pic->p[U_PLANE].i_pitch, \
p_dst
->
format
.
i_y_offset
=
p_src
->
format
.
i_y_offset
;
pic->p[V_PLANE].i_pitch \
}
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
,
};
Copy420_P_to_SP
(
p_dst
,
plane
,
pitch
,
#define GET_PLANES( pic ) { \
p_src
->
format
.
i_y_offset
+
p_src
->
format
.
i_visible_height
,
pic->p[Y_PLANE].p_pixels, \
&
p_sys
->
cache
);
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
...
@@ -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
,
static
void
I420_NV12
(
filter_t
*
p_filter
,
picture_t
*
p_src
,
picture_t
*
p_dst
)
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,
...
@@ -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
,
static
void
YV12_NV12
(
filter_t
*
p_filter
,
picture_t
*
p_src
,
picture_t
*
p_dst
)
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 */
/* 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