Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
a3883709
Commit
a3883709
authored
Aug 01, 2007
by
Damien Fouilleul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
video_chroma: added I420_ABGR32 support (mostly for opengl), some clean up as well
parent
7b64c064
Changes
8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
1600 additions
and
1248 deletions
+1600
-1248
modules/video_chroma/i420_rgb.c
modules/video_chroma/i420_rgb.c
+18
-1
modules/video_chroma/i420_rgb.h
modules/video_chroma/i420_rgb.h
+1
-0
modules/video_chroma/i420_rgb16.c
modules/video_chroma/i420_rgb16.c
+387
-455
modules/video_chroma/i420_rgb_mmx.h
modules/video_chroma/i420_rgb_mmx.h
+791
-666
modules/video_chroma/i420_yuy2.c
modules/video_chroma/i420_yuy2.c
+12
-12
modules/video_chroma/i420_yuy2.h
modules/video_chroma/i420_yuy2.h
+307
-87
modules/video_chroma/i422_yuy2.c
modules/video_chroma/i422_yuy2.c
+35
-26
modules/video_chroma/i422_yuy2.h
modules/video_chroma/i422_yuy2.h
+49
-1
No files found.
modules/video_chroma/i420_rgb.c
View file @
a3883709
...
...
@@ -155,6 +155,15 @@ static int Activate( vlc_object_t *p_this )
msg_Dbg
(
p_this
,
"RGB pixel format is A8R8G8B8"
);
p_vout
->
chroma
.
pf_convert
=
E_
(
I420_A8R8G8B8
);
}
else
if
(
p_vout
->
output
.
i_rmask
==
0xff000000
&&
p_vout
->
output
.
i_gmask
==
0x00ff0000
&&
p_vout
->
output
.
i_bmask
==
0x0000ff00
)
{
/* R8G8B8A8 pixel format */
msg_Dbg
(
p_this
,
"RGB pixel format is R8G8B8A8"
);
//p_vout->chroma.pf_convert = E_(I420_B8G8R8A8);
return
-
1
;
}
else
if
(
p_vout
->
output
.
i_rmask
==
0x0000ff00
&&
p_vout
->
output
.
i_gmask
==
0x00ff0000
&&
p_vout
->
output
.
i_bmask
==
0xff000000
)
...
...
@@ -163,10 +172,18 @@ static int Activate( vlc_object_t *p_this )
msg_Dbg
(
p_this
,
"RGB pixel format is B8G8R8A8"
);
p_vout
->
chroma
.
pf_convert
=
E_
(
I420_B8G8R8A8
);
}
else
if
(
p_vout
->
output
.
i_rmask
==
0x000000ff
&&
p_vout
->
output
.
i_gmask
==
0x0000ff00
&&
p_vout
->
output
.
i_bmask
==
0x00ff0000
)
{
/* A8B8G8R8 pixel format */
msg_Dbg
(
p_this
,
"RGB pixel format is A8B8G8R8"
);
p_vout
->
chroma
.
pf_convert
=
E_
(
I420_A8B8G8R8
);
}
else
return
-
1
;
#else
/
/
generic C chroma converter */
/
*
generic C chroma converter */
p_vout
->
chroma
.
pf_convert
=
E_
(
I420_RGB32
);
#endif
break
;
...
...
modules/video_chroma/i420_rgb.h
View file @
a3883709
...
...
@@ -65,6 +65,7 @@ void E_(I420_R5G5B5) ( vout_thread_t *, picture_t *, picture_t * );
void
E_
(
I420_R5G6B5
)
(
vout_thread_t
*
,
picture_t
*
,
picture_t
*
);
void
E_
(
I420_A8R8G8B8
)
(
vout_thread_t
*
,
picture_t
*
,
picture_t
*
);
void
E_
(
I420_B8G8R8A8
)
(
vout_thread_t
*
,
picture_t
*
,
picture_t
*
);
void
E_
(
I420_A8B8G8R8
)
(
vout_thread_t
*
,
picture_t
*
,
picture_t
*
);
#endif
/*****************************************************************************
...
...
modules/video_chroma/i420_rgb16.c
View file @
a3883709
This diff is collapsed.
Click to expand it.
modules/video_chroma/i420_rgb_mmx.h
View file @
a3883709
This diff is collapsed.
Click to expand it.
modules/video_chroma/i420_yuy2.c
View file @
a3883709
...
...
@@ -307,7 +307,7 @@ static void I420_YUY2( vout_thread_t *p_vout, picture_t *p_source,
#if defined (MODULE_NAME_IS_i420_yuy2_mmx)
/* re-enable FPU registers */
__asm__
__volatile__
(
"emms"
)
;
MMX_END
;
#endif
#if defined (MODULE_NAME_IS_i420_yuy2_altivec)
...
...
@@ -348,8 +348,6 @@ static void I420_YUY2( vout_thread_t *p_vout, picture_t *p_source,
p_line1
+=
i_dest_margin
;
p_line2
+=
i_dest_margin
;
}
/* make sure all SSE2 stores are visible thereafter */
__asm__
__volatile__
(
"sfence"
);
}
else
{
...
...
@@ -379,6 +377,8 @@ static void I420_YUY2( vout_thread_t *p_vout, picture_t *p_source,
p_line2
+=
i_dest_margin
;
}
}
/* make sure all SSE2 stores are visible thereafter */
SSE2_END
;
#endif // defined(MODULE_NAME_IS_i420_yuy2_sse2)
}
...
...
@@ -518,7 +518,7 @@ static void I420_YVYU( vout_thread_t *p_vout, picture_t *p_source,
#if defined (MODULE_NAME_IS_i420_yuy2_mmx)
/* re-enable FPU registers */
__asm__
__volatile__
(
"emms"
)
;
MMX_END
;
#endif
#if defined (MODULE_NAME_IS_i420_yuy2_altivec)
...
...
@@ -558,8 +558,6 @@ static void I420_YVYU( vout_thread_t *p_vout, picture_t *p_source,
p_line1
+=
i_dest_margin
;
p_line2
+=
i_dest_margin
;
}
/* make sure all SSE2 stores are visible thereafter */
__asm__
__volatile__
(
"sfence"
);
}
else
{
...
...
@@ -589,6 +587,8 @@ static void I420_YVYU( vout_thread_t *p_vout, picture_t *p_source,
p_line2
+=
i_dest_margin
;
}
}
/* make sure all SSE2 stores are visible thereafter */
SSE2_END
;
#endif // defined(MODULE_NAME_IS_i420_yuy2_sse2)
}
...
...
@@ -727,7 +727,7 @@ static void I420_UYVY( vout_thread_t *p_vout, picture_t *p_source,
#if defined (MODULE_NAME_IS_i420_yuy2_mmx)
/* re-enable FPU registers */
__asm__
__volatile__
(
"emms"
)
;
MMX_END
;
#endif
#if defined (MODULE_NAME_IS_i420_yuy2_altivec)
...
...
@@ -767,8 +767,6 @@ static void I420_UYVY( vout_thread_t *p_vout, picture_t *p_source,
p_line1
+=
i_dest_margin
;
p_line2
+=
i_dest_margin
;
}
/* make sure all SSE2 stores are visible thereafter */
__asm__
__volatile__
(
"sfence"
);
}
else
{
...
...
@@ -798,6 +796,8 @@ static void I420_UYVY( vout_thread_t *p_vout, picture_t *p_source,
p_line2
+=
i_dest_margin
;
}
}
/* make sure all SSE2 stores are visible thereafter */
SSE2_END
;
#endif // defined(MODULE_NAME_IS_i420_yuy2_sse2)
}
...
...
@@ -871,7 +871,7 @@ static void I420_cyuv( vout_thread_t *p_vout, picture_t *p_source,
#if defined (MODULE_NAME_IS_i420_yuy2_mmx)
/* re-enable FPU registers */
__asm__
__volatile__
(
"emms"
)
;
MMX_END
;
#endif
#else // defined(MODULE_NAME_IS_i420_yuy2_sse2)
...
...
@@ -907,8 +907,6 @@ static void I420_cyuv( vout_thread_t *p_vout, picture_t *p_source,
p_line1
+=
i_dest_margin
;
p_line2
+=
i_dest_margin
;
}
/* make sure all SSE2 stores are visible thereafter */
__asm__
__volatile__
(
"sfence"
);
}
else
{
...
...
@@ -938,6 +936,8 @@ static void I420_cyuv( vout_thread_t *p_vout, picture_t *p_source,
p_line2
+=
i_dest_margin
;
}
}
/* make sure all SSE2 stores are visible thereafter */
SSE2_END
;
#endif // defined(MODULE_NAME_IS_i420_yuy2_sse2)
}
#endif // !defined (MODULE_NAME_IS_i420_yuy2_altivec)
...
...
modules/video_chroma/i420_yuy2.h
View file @
a3883709
This diff is collapsed.
Click to expand it.
modules/video_chroma/i422_yuy2.c
View file @
a3883709
...
...
@@ -5,6 +5,7 @@
* $Id$
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Damien Fouilleul <damienf@videolan.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
...
...
@@ -160,15 +161,17 @@ static void I422_YUY2( vout_thread_t *p_vout, picture_t *p_source,
C_YUV422_YUYV
(
p_line
,
p_y
,
p_u
,
p_v
);
C_YUV422_YUYV
(
p_line
,
p_y
,
p_u
,
p_v
);
C_YUV422_YUYV
(
p_line
,
p_y
,
p_u
,
p_v
);
#else
__asm__
(
".p2align 3"
MMX_YUV422_YUYV
:
:
"r"
(
p_line
),
"r"
(
p_y
),
"r"
(
p_u
),
"r"
(
p_v
)
);
p_line
+=
16
;
p_y
+=
8
;
p_u
+=
4
;
p_v
+=
4
;
#elif defined (MODULE_NAME_IS_i422_yuy2_mmx)
MMX_CALL
(
MMX_YUV422_YUYV
);
#endif
}
p_pixels
+=
i_pitch
;
}
#if defined (MODULE_NAME_IS_i422_yuy2_mmx)
MMX_END
;
#elif defined (MODULE_NAME_IS_i422_yuy2_sse2)
SSE2_END
;
#endif
}
/*****************************************************************************
...
...
@@ -195,15 +198,17 @@ static void I422_YVYU( vout_thread_t *p_vout, picture_t *p_source,
C_YUV422_YVYU
(
p_line
,
p_y
,
p_u
,
p_v
);
C_YUV422_YVYU
(
p_line
,
p_y
,
p_u
,
p_v
);
C_YUV422_YVYU
(
p_line
,
p_y
,
p_u
,
p_v
);
#else
__asm__
(
".p2align 3"
MMX_YUV422_YVYU
:
:
"r"
(
p_line
),
"r"
(
p_y
),
"r"
(
p_u
),
"r"
(
p_v
)
);
p_line
+=
16
;
p_y
+=
8
;
p_u
+=
4
;
p_v
+=
4
;
#elif defined (MODULE_NAME_IS_i422_yuy2_mmx)
MMX_CALL
(
MMX_YUV422_YVYU
);
#endif
}
p_pixels
+=
i_pitch
;
}
#if defined (MODULE_NAME_IS_i422_yuy2_mmx)
MMX_END
;
#elif defined (MODULE_NAME_IS_i422_yuy2_sse2)
SSE2_END
;
#endif
}
/*****************************************************************************
...
...
@@ -230,15 +235,17 @@ static void I422_UYVY( vout_thread_t *p_vout, picture_t *p_source,
C_YUV422_UYVY
(
p_line
,
p_y
,
p_u
,
p_v
);
C_YUV422_UYVY
(
p_line
,
p_y
,
p_u
,
p_v
);
C_YUV422_UYVY
(
p_line
,
p_y
,
p_u
,
p_v
);
#else
__asm__
(
".p2align 3"
MMX_YUV422_UYVY
:
:
"r"
(
p_line
),
"r"
(
p_y
),
"r"
(
p_u
),
"r"
(
p_v
)
);
p_line
+=
16
;
p_y
+=
8
;
p_u
+=
4
;
p_v
+=
4
;
#elif defined (MODULE_NAME_IS_i422_yuy2_mmx)
MMX_CALL
(
MMX_YUV422_UYVY
);
#endif
}
p_pixels
+=
i_pitch
;
}
#if defined (MODULE_NAME_IS_i422_yuy2_mmx)
MMX_END
;
#elif defined (MODULE_NAME_IS_i422_yuy2_sse2)
SSE2_END
;
#endif
}
/*****************************************************************************
...
...
@@ -275,14 +282,16 @@ static void I422_cyuv( vout_thread_t *p_vout, picture_t *p_source,
C_YUV422_UYVY
(
p_line
,
p_y
,
p_u
,
p_v
);
C_YUV422_UYVY
(
p_line
,
p_y
,
p_u
,
p_v
);
C_YUV422_UYVY
(
p_line
,
p_y
,
p_u
,
p_v
);
#else
__asm__
(
".p2align 3"
MMX_YUV422_UYVY
:
:
"r"
(
p_line
),
"r"
(
p_y
),
"r"
(
p_u
),
"r"
(
p_v
)
);
p_line
+=
16
;
p_y
+=
8
;
p_u
+=
4
;
p_v
+=
4
;
#elif defined (MODULE_NAME_IS_i422_yuy2_mmx)
MMX_CALL
(
MMX_YUV422_UYVY
);
#endif
}
}
#if defined (MODULE_NAME_IS_i422_yuy2_mmx)
MMX_END
;
#elif defined (MODULE_NAME_IS_i422_yuy2_sse2)
SSE2_END
;
#endif
}
/*****************************************************************************
...
...
modules/video_chroma/i422_yuy2.h
View file @
a3883709
...
...
@@ -5,6 +5,7 @@
* $Id$
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Damien Fouilleul <damienf@videolan.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
...
...
@@ -23,6 +24,24 @@
#ifdef MODULE_NAME_IS_i422_yuy2_mmx
#if defined(CAN_COMPILE_MMX)
/* MMX assembly */
#define MMX_CALL(MMX_INSTRUCTIONS) \
do { \
__asm__ __volatile__( \
".p2align 3 \n\t" \
MMX_INSTRUCTIONS \
: \
: "r" (p_line), "r" (p_y), \
"r" (p_u), "r" (p_v) ); \
p_line += 16; p_y += 8; \
p_u += 4; p_v += 4; \
} while(0)
#define MMX_END __asm__ __volatile__ ( "emms" )
#define MMX_YUV422_YUYV " \n\
movq (%1), %%mm0 # Load 8 Y y7 y6 y5 y4 y3 y2 y1 y0 \n\
movd (%2), %%mm1 # Load 4 Cb 00 00 00 00 u3 u2 u1 u0 \n\
...
...
@@ -62,7 +81,36 @@ movq %%mm1, 8(%0) # Store high UYVY \n\
#define MMX_YUV422_Y211 " \n\
"
#else
#elif defined(HAVE_MMX_INTRINSICS)
/* MMX intrinsics */
#include <mmintrin.h>
#define MMX_END _mm_empty()
#endif
#elif defined( MODULE_NAME_IS_i422_yuy2_sse2 )
#if defined(CAN_COMPILE_SSE2)
/* SSE2 assembly */
#define SSE2_END __asm__ __volatile__ ( "sfence" ::: "memory" )
#elif defined(HAVE_SSE2_INTRINSICS)
/* SSE2 intrinsics */
#include <emmintrin.h>
#define SSE2_END _mm_sfence()
#endif
#elif defined (MODULE_NAME_IS_i422_yuy2)
#define C_YUV422_YUYV( p_line, p_y, p_u, p_v ) \
*(p_line)++ = *(p_y)++; \
...
...
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