Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
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
videolan
vlc-2-2
Commits
c4247c7a
Commit
c4247c7a
authored
Mar 18, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
transform: add YUY2 rotations
parent
bb0ee530
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
2 deletions
+39
-2
modules/video_filter/transform.c
modules/video_filter/transform.c
+39
-2
No files found.
modules/video_filter/transform.c
View file @
c4247c7a
...
@@ -159,6 +159,40 @@ static void Plane32_##f(plane_t *restrict dst, const plane_t *restrict src) \
...
@@ -159,6 +159,40 @@ static void Plane32_##f(plane_t *restrict dst, const plane_t *restrict src) \
src_pixels[sy * src_width + sx]; \
src_pixels[sy * src_width + sx]; \
} \
} \
} \
} \
} \
\
static void YUYV_##f(plane_t *restrict dst, const plane_t *restrict src) \
{ \
unsigned dst_visible_width = dst->i_visible_pitch / 2; \
\
for (int y = 0; y < dst->i_visible_lines; y += 2) { \
for (unsigned x = 0; x < dst_visible_width; x+= 2) { \
int sx0, sy0, sx1, sy1; \
(f)(&sx0, &sy0, dst_visible_width, dst->i_visible_lines, x, y); \
(f)(&sx1, &sy1, dst_visible_width, dst->i_visible_lines, \
x + 1, y + 1); \
dst->p_pixels[(y + 0) * dst->i_pitch + 2 * (x + 0)] = \
src->p_pixels[sy0 * src->i_pitch + 2 * sx0]; \
dst->p_pixels[(y + 0) * dst->i_pitch + 2 * (x + 1)] = \
src->p_pixels[sy1 * src->i_pitch + 2 * sx0]; \
dst->p_pixels[(y + 1) * dst->i_pitch + 2 * (x + 0)] = \
src->p_pixels[sy0 * src->i_pitch + 2 * sx1]; \
dst->p_pixels[(y + 1) * dst->i_pitch + 2 * (x + 1)] = \
src->p_pixels[sy1 * src->i_pitch + 2 * sx1]; \
\
int sx, sy, u, v; \
(f)(&sx, &sy, dst_visible_width / 2, dst->i_visible_lines / 2, \
x / 2, y / 2); \
u = (1 + src->p_pixels[2 * sy * src->i_pitch + 4 * sx + 1] + \
src->p_pixels[(2 * sy + 1) * src->i_pitch + 4 * sx + 1]) / 2; \
v = (1 + src->p_pixels[2 * sy * src->i_pitch + 4 * sx + 3] + \
src->p_pixels[(2 * sy + 1) * src->i_pitch + 4 * sx + 3]) / 2; \
dst->p_pixels[(y + 0) * dst->i_pitch + 2 * x + 1] = u; \
dst->p_pixels[(y + 0) * dst->i_pitch + 2 * x + 3] = v; \
dst->p_pixels[(y + 1) * dst->i_pitch + 2 * x + 1] = u; \
dst->p_pixels[(y + 1) * dst->i_pitch + 2 * x + 3] = v; \
} \
} \
}
}
PLANAR
(
HFlip
)
PLANAR
(
HFlip
)
...
@@ -177,10 +211,11 @@ typedef struct {
...
@@ -177,10 +211,11 @@ typedef struct {
void
(
*
plane8
)
(
plane_t
*
dst
,
const
plane_t
*
src
);
void
(
*
plane8
)
(
plane_t
*
dst
,
const
plane_t
*
src
);
void
(
*
plane16
)(
plane_t
*
dst
,
const
plane_t
*
src
);
void
(
*
plane16
)(
plane_t
*
dst
,
const
plane_t
*
src
);
void
(
*
plane32
)(
plane_t
*
dst
,
const
plane_t
*
src
);
void
(
*
plane32
)(
plane_t
*
dst
,
const
plane_t
*
src
);
void
(
*
yuyv
)(
plane_t
*
dst
,
const
plane_t
*
src
);
}
transform_description_t
;
}
transform_description_t
;
#define DESC(str, rotated, f, invf) \
#define DESC(str, rotated, f, invf) \
{ str, rotated, f, invf, Plane8_##f, Plane16_##f, Plane32_##f }
{ str, rotated, f, invf, Plane8_##f, Plane16_##f, Plane32_##f
, YUYV_##f
}
static
const
transform_description_t
descriptions
[]
=
{
static
const
transform_description_t
descriptions
[]
=
{
DESC
(
"90"
,
true
,
R90
,
R270
),
DESC
(
"90"
,
true
,
R90
,
R270
),
...
@@ -311,8 +346,10 @@ static int Open(vlc_object_t *object)
...
@@ -311,8 +346,10 @@ static int Open(vlc_object_t *object)
/* Deal with weird packed formats */
/* Deal with weird packed formats */
switch
(
src
->
i_chroma
)
{
switch
(
src
->
i_chroma
)
{
case
VLC_CODEC_YUYV
:
case
VLC_CODEC_YUYV
:
case
VLC_CODEC_UYVY
:
case
VLC_CODEC_YVYU
:
case
VLC_CODEC_YVYU
:
sys
->
plane
=
dsc
->
is_rotated
?
dsc
->
yuyv
:
dsc
->
plane32
;
break
;
case
VLC_CODEC_UYVY
:
case
VLC_CODEC_VYUY
:
case
VLC_CODEC_VYUY
:
if
(
dsc
->
is_rotated
)
{
if
(
dsc
->
is_rotated
)
{
msg_Err
(
filter
,
"Format rotation not possible (chroma %4.4s)"
,
msg_Err
(
filter
,
"Format rotation not possible (chroma %4.4s)"
,
...
...
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