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
14ee5e98
Commit
14ee5e98
authored
Sep 14, 2013
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
i420_rgb: split files and clean up
parent
38917a22
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1613 additions
and
1574 deletions
+1613
-1574
modules/video_chroma/Makefile.am
modules/video_chroma/Makefile.am
+4
-4
modules/video_chroma/i420_rgb.c
modules/video_chroma/i420_rgb.c
+47
-70
modules/video_chroma/i420_rgb.h
modules/video_chroma/i420_rgb.h
+7
-4
modules/video_chroma/i420_rgb16.c
modules/video_chroma/i420_rgb16.c
+88
-1496
modules/video_chroma/i420_rgb16_x86.c
modules/video_chroma/i420_rgb16_x86.c
+1467
-0
No files found.
modules/video_chroma/Makefile.am
View file @
14ee5e98
...
@@ -63,8 +63,8 @@ endif
...
@@ -63,8 +63,8 @@ endif
# MMX
# MMX
libi420_rgb_mmx_plugin_la_SOURCES
=
i420_rgb.c i420_rgb.h
\
libi420_rgb_mmx_plugin_la_SOURCES
=
i420_rgb.c i420_rgb.h
\
i420_rgb16.c i420_rgb_mmx.h
i420_rgb16
_x86
.c i420_rgb_mmx.h
libi420_rgb_mmx_plugin_la_CPPFLAGS
=
$(AM_CPPFLAGS)
libi420_rgb_mmx_plugin_la_CPPFLAGS
=
$(AM_CPPFLAGS)
-DMMX
libi420_yuy2_mmx_plugin_la_SOURCES
=
i420_yuy2.c i420_yuy2.h
libi420_yuy2_mmx_plugin_la_SOURCES
=
i420_yuy2.c i420_yuy2.h
libi420_yuy2_mmx_plugin_la_CPPFLAGS
=
$(AM_CPPFLAGS)
libi420_yuy2_mmx_plugin_la_CPPFLAGS
=
$(AM_CPPFLAGS)
...
@@ -81,8 +81,8 @@ endif
...
@@ -81,8 +81,8 @@ endif
# SSE2
# SSE2
libi420_rgb_sse2_plugin_la_SOURCES
=
i420_rgb.c i420_rgb.h
\
libi420_rgb_sse2_plugin_la_SOURCES
=
i420_rgb.c i420_rgb.h
\
i420_rgb16.c i420_rgb_sse2.h
i420_rgb16
_x86
.c i420_rgb_sse2.h
libi420_rgb_sse2_plugin_la_CPPFLAGS
=
$(AM_CPPFLAGS)
libi420_rgb_sse2_plugin_la_CPPFLAGS
=
$(AM_CPPFLAGS)
-DSSE2
libi420_yuy2_sse2_plugin_la_SOURCES
=
i420_yuy2.c i420_yuy2.h
libi420_yuy2_sse2_plugin_la_SOURCES
=
i420_yuy2.c i420_yuy2.h
libi420_yuy2_sse2_plugin_la_CPPFLAGS
=
$(AM_CPPFLAGS)
libi420_yuy2_sse2_plugin_la_CPPFLAGS
=
$(AM_CPPFLAGS)
...
...
modules/video_chroma/i420_rgb.c
View file @
14ee5e98
...
@@ -38,19 +38,22 @@
...
@@ -38,19 +38,22 @@
#include <vlc_cpu.h>
#include <vlc_cpu.h>
#include "i420_rgb.h"
#include "i420_rgb.h"
#if defined (MODULE_NAME_IS_i420_rgb)
#ifdef PLAIN
# include "i420_rgb_c.h"
# include "i420_rgb_c.h"
static
picture_t
*
I420_RGB8_Filter
(
filter_t
*
,
picture_t
*
);
static
picture_t
*
I420_RGB8_Filter
(
filter_t
*
,
picture_t
*
);
// static picture_t *I420_RGB16_dither_Filter ( filter_t *, picture_t * );
static
picture_t
*
I420_RGB16_Filter
(
filter_t
*
,
picture_t
*
);
static
picture_t
*
I420_RGB16_Filter
(
filter_t
*
,
picture_t
*
);
static
picture_t
*
I420_RGB32_Filter
(
filter_t
*
,
picture_t
*
);
static
picture_t
*
I420_RGB32_Filter
(
filter_t
*
,
picture_t
*
);
static
void
SetGammaTable
(
int
*
pi_table
,
double
f_gamma
);
static
void
SetYUV
(
filter_t
*
);
static
void
Set8bppPalette
(
filter_t
*
,
uint8_t
*
);
#else
#else
static
picture_t
*
I420_R5G5B5_Filter
(
filter_t
*
,
picture_t
*
);
static
picture_t
*
I420_R5G5B5_Filter
(
filter_t
*
,
picture_t
*
);
static
picture_t
*
I420_R5G6B5_Filter
(
filter_t
*
,
picture_t
*
);
static
picture_t
*
I420_R5G6B5_Filter
(
filter_t
*
,
picture_t
*
);
static
picture_t
*
I420_A8R8G8B8_Filter
(
filter_t
*
,
picture_t
*
);
static
picture_t
*
I420_A8R8G8B8_Filter
(
filter_t
*
,
picture_t
*
);
static
picture_t
*
I420_R8G8B8A8_Filter
(
filter_t
*
,
picture_t
*
);
static
picture_t
*
I420_R8G8B8A8_Filter
(
filter_t
*
,
picture_t
*
);
static
picture_t
*
I420_B8G8R8A8_Filter
(
filter_t
*
,
picture_t
*
);
static
picture_t
*
I420_B8G8R8A8_Filter
(
filter_t
*
,
picture_t
*
);
static
picture_t
*
I420_A8B8G8R8_Filter
(
filter_t
*
,
picture_t
*
);
static
picture_t
*
I420_A8B8G8R8_Filter
(
filter_t
*
,
picture_t
*
);
#endif
#endif
/*****************************************************************************
/*****************************************************************************
...
@@ -65,36 +68,27 @@
...
@@ -65,36 +68,27 @@
<< p_filter->fmt_out.video.i_lbshift))
<< p_filter->fmt_out.video.i_lbshift))
/*****************************************************************************
/*****************************************************************************
*
Local and extern prototypes
.
*
Module descriptor
.
*****************************************************************************/
*****************************************************************************/
static
int
Activate
(
vlc_object_t
*
);
static
int
Activate
(
vlc_object_t
*
);
static
void
Deactivate
(
vlc_object_t
*
);
static
void
Deactivate
(
vlc_object_t
*
);
#if defined (MODULE_NAME_IS_i420_rgb)
static
void
SetGammaTable
(
int
*
pi_table
,
double
f_gamma
);
static
void
SetYUV
(
filter_t
*
);
static
void
Set8bppPalette
(
filter_t
*
,
uint8_t
*
);
#endif
/*****************************************************************************
* Module descriptor.
*****************************************************************************/
vlc_module_begin
()
vlc_module_begin
()
#if defined (MODULE_NAME_IS_i420_rgb)
#if defined (SSE2)
set_description
(
N_
(
"I420,IYUV,YV12 to "
"RGB2,RV15,RV16,RV24,RV32 conversions"
)
)
set_capability
(
"video filter2"
,
80
)
# define vlc_CPU_capable() (true)
#elif defined (MODULE_NAME_IS_i420_rgb_mmx)
set_description
(
N_
(
"MMX I420,IYUV,YV12 to "
"RV15,RV16,RV24,RV32 conversions"
)
)
set_capability
(
"video filter2"
,
100
)
# define vlc_CPU_capable() vlc_CPU_MMX()
#elif defined (MODULE_NAME_IS_i420_rgb_sse2)
set_description
(
N_
(
"SSE2 I420,IYUV,YV12 to "
set_description
(
N_
(
"SSE2 I420,IYUV,YV12 to "
"RV15,RV16,RV24,RV32 conversions"
)
)
"RV15,RV16,RV24,RV32 conversions"
)
)
set_capability
(
"video filter2"
,
120
)
set_capability
(
"video filter2"
,
120
)
# define vlc_CPU_capable() vlc_CPU_SSE2()
# define vlc_CPU_capable() vlc_CPU_SSE2()
#elif defined (MMX)
set_description
(
N_
(
"MMX I420,IYUV,YV12 to "
"RV15,RV16,RV24,RV32 conversions"
)
)
set_capability
(
"video filter2"
,
100
)
# define vlc_CPU_capable() vlc_CPU_MMX()
#else
set_description
(
N_
(
"I420,IYUV,YV12 to "
"RGB2,RV15,RV16,RV24,RV32 conversions"
)
)
set_capability
(
"video filter2"
,
80
)
# define vlc_CPU_capable() (true)
#endif
#endif
set_callbacks
(
Activate
,
Deactivate
)
set_callbacks
(
Activate
,
Deactivate
)
vlc_module_end
()
vlc_module_end
()
...
@@ -107,7 +101,7 @@ vlc_module_end ()
...
@@ -107,7 +101,7 @@ vlc_module_end ()
static
int
Activate
(
vlc_object_t
*
p_this
)
static
int
Activate
(
vlc_object_t
*
p_this
)
{
{
filter_t
*
p_filter
=
(
filter_t
*
)
p_this
;
filter_t
*
p_filter
=
(
filter_t
*
)
p_this
;
#if
defined (MODULE_NAME_IS_i420_rgb)
#if
def PLAIN
size_t
i_tables_size
;
size_t
i_tables_size
;
#endif
#endif
...
@@ -125,14 +119,9 @@ static int Activate( vlc_object_t *p_this )
...
@@ -125,14 +119,9 @@ static int Activate( vlc_object_t *p_this )
case
VLC_CODEC_I420
:
case
VLC_CODEC_I420
:
switch
(
p_filter
->
fmt_out
.
video
.
i_chroma
)
switch
(
p_filter
->
fmt_out
.
video
.
i_chroma
)
{
{
#if defined (MODULE_NAME_IS_i420_rgb)
#ifndef PLAIN
case
VLC_CODEC_RGB8
:
p_filter
->
pf_video_filter
=
I420_RGB8_Filter
;
break
;
#endif
case
VLC_CODEC_RGB15
:
case
VLC_CODEC_RGB15
:
case
VLC_CODEC_RGB16
:
case
VLC_CODEC_RGB16
:
#if ! defined (MODULE_NAME_IS_i420_rgb)
/* If we don't have support for the bitmasks, bail out */
/* If we don't have support for the bitmasks, bail out */
if
(
(
p_filter
->
fmt_out
.
video
.
i_rmask
==
0x7c00
if
(
(
p_filter
->
fmt_out
.
video
.
i_rmask
==
0x7c00
&&
p_filter
->
fmt_out
.
video
.
i_gmask
==
0x03e0
&&
p_filter
->
fmt_out
.
video
.
i_gmask
==
0x03e0
...
@@ -152,19 +141,8 @@ static int Activate( vlc_object_t *p_this )
...
@@ -152,19 +141,8 @@ static int Activate( vlc_object_t *p_this )
}
}
else
else
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
#else
// generic C chroma converter */
p_filter
->
pf_video_filter
=
I420_RGB16_Filter
;
#endif
break
;
break
;
#if 0
/* Hmmm, is there only X11 using 32bits per pixel for RV24 ? */
case VLC_CODEC_RGB24:
#endif
case
VLC_CODEC_RGB32
:
case
VLC_CODEC_RGB32
:
#if ! defined (MODULE_NAME_IS_i420_rgb)
/* If we don't have support for the bitmasks, bail out */
/* If we don't have support for the bitmasks, bail out */
if
(
p_filter
->
fmt_out
.
video
.
i_rmask
==
0x00ff0000
if
(
p_filter
->
fmt_out
.
video
.
i_rmask
==
0x00ff0000
&&
p_filter
->
fmt_out
.
video
.
i_gmask
==
0x0000ff00
&&
p_filter
->
fmt_out
.
video
.
i_gmask
==
0x0000ff00
...
@@ -200,12 +178,19 @@ static int Activate( vlc_object_t *p_this )
...
@@ -200,12 +178,19 @@ static int Activate( vlc_object_t *p_this )
}
}
else
else
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
break
;
#else
#else
/* generic C chroma converter */
case
VLC_CODEC_RGB8
:
p_filter
->
pf_video_filter
=
I420_RGB8_Filter
;
break
;
case
VLC_CODEC_RGB15
:
case
VLC_CODEC_RGB16
:
p_filter
->
pf_video_filter
=
I420_RGB16_Filter
;
break
;
case
VLC_CODEC_RGB32
:
p_filter
->
pf_video_filter
=
I420_RGB32_Filter
;
p_filter
->
pf_video_filter
=
I420_RGB32_Filter
;
#endif
break
;
break
;
#endif
default:
default:
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
...
@@ -223,22 +208,19 @@ static int Activate( vlc_object_t *p_this )
...
@@ -223,22 +208,19 @@ static int Activate( vlc_object_t *p_this )
switch
(
p_filter
->
fmt_out
.
video
.
i_chroma
)
switch
(
p_filter
->
fmt_out
.
video
.
i_chroma
)
{
{
#if
defined (MODULE_NAME_IS_i420_rgb)
#if
def PLAIN
case
VLC_CODEC_RGB8
:
case
VLC_CODEC_RGB8
:
p_filter
->
p_sys
->
p_buffer
=
malloc
(
VOUT_MAX_WIDTH
);
p_filter
->
p_sys
->
p_buffer
=
malloc
(
VOUT_MAX_WIDTH
);
break
;
break
;
#endif
#endif
case
VLC_CODEC_RGB15
:
case
VLC_CODEC_RGB15
:
case
VLC_CODEC_RGB16
:
case
VLC_CODEC_RGB16
:
p_filter
->
p_sys
->
p_buffer
=
malloc
(
VOUT_MAX_WIDTH
*
2
);
p_filter
->
p_sys
->
p_buffer
=
malloc
(
VOUT_MAX_WIDTH
*
2
);
break
;
break
;
case
VLC_CODEC_RGB24
:
case
VLC_CODEC_RGB24
:
case
VLC_CODEC_RGB32
:
case
VLC_CODEC_RGB32
:
p_filter
->
p_sys
->
p_buffer
=
malloc
(
VOUT_MAX_WIDTH
*
4
);
p_filter
->
p_sys
->
p_buffer
=
malloc
(
VOUT_MAX_WIDTH
*
4
);
break
;
break
;
default:
default:
p_filter
->
p_sys
->
p_buffer
=
NULL
;
p_filter
->
p_sys
->
p_buffer
=
NULL
;
break
;
break
;
...
@@ -261,7 +243,7 @@ static int Activate( vlc_object_t *p_this )
...
@@ -261,7 +243,7 @@ static int Activate( vlc_object_t *p_this )
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
#if
defined (MODULE_NAME_IS_i420_rgb)
#if
def PLAIN
switch
(
p_filter
->
fmt_out
.
video
.
i_chroma
)
switch
(
p_filter
->
fmt_out
.
video
.
i_chroma
)
{
{
case
VLC_CODEC_RGB8
:
case
VLC_CODEC_RGB8
:
...
@@ -300,7 +282,7 @@ static void Deactivate( vlc_object_t *p_this )
...
@@ -300,7 +282,7 @@ static void Deactivate( vlc_object_t *p_this )
{
{
filter_t
*
p_filter
=
(
filter_t
*
)
p_this
;
filter_t
*
p_filter
=
(
filter_t
*
)
p_this
;
#if
defined (MODULE_NAME_IS_i420_rgb)
#if
def PLAIN
free
(
p_filter
->
p_sys
->
p_base
);
free
(
p_filter
->
p_sys
->
p_base
);
#endif
#endif
free
(
p_filter
->
p_sys
->
p_offset
);
free
(
p_filter
->
p_sys
->
p_offset
);
...
@@ -308,21 +290,18 @@ static void Deactivate( vlc_object_t *p_this )
...
@@ -308,21 +290,18 @@ static void Deactivate( vlc_object_t *p_this )
free
(
p_filter
->
p_sys
);
free
(
p_filter
->
p_sys
);
}
}
#if defined (MODULE_NAME_IS_i420_rgb)
#ifndef PLAIN
VIDEO_FILTER_WRAPPER
(
I420_RGB8
)
VIDEO_FILTER_WRAPPER
(
I420_RGB16
)
//VIDEO_FILTER_WRAPPER( I420_RGB16_dither )
VIDEO_FILTER_WRAPPER
(
I420_RGB32
)
#else
VIDEO_FILTER_WRAPPER
(
I420_R5G5B5
)
VIDEO_FILTER_WRAPPER
(
I420_R5G5B5
)
VIDEO_FILTER_WRAPPER
(
I420_R5G6B5
)
VIDEO_FILTER_WRAPPER
(
I420_R5G6B5
)
VIDEO_FILTER_WRAPPER
(
I420_A8R8G8B8
)
VIDEO_FILTER_WRAPPER
(
I420_A8R8G8B8
)
VIDEO_FILTER_WRAPPER
(
I420_R8G8B8A8
)
VIDEO_FILTER_WRAPPER
(
I420_R8G8B8A8
)
VIDEO_FILTER_WRAPPER
(
I420_B8G8R8A8
)
VIDEO_FILTER_WRAPPER
(
I420_B8G8R8A8
)
VIDEO_FILTER_WRAPPER
(
I420_A8B8G8R8
)
VIDEO_FILTER_WRAPPER
(
I420_A8B8G8R8
)
#endif
#else
VIDEO_FILTER_WRAPPER
(
I420_RGB8
)
VIDEO_FILTER_WRAPPER
(
I420_RGB16
)
VIDEO_FILTER_WRAPPER
(
I420_RGB32
)
#if defined (MODULE_NAME_IS_i420_rgb)
/*****************************************************************************
/*****************************************************************************
* SetGammaTable: return intensity table transformed by gamma curve.
* SetGammaTable: return intensity table transformed by gamma curve.
*****************************************************************************
*****************************************************************************
...
@@ -538,6 +517,4 @@ static void Set8bppPalette( filter_t *p_filter, uint8_t *p_rgb8 )
...
@@ -538,6 +517,4 @@ static void Set8bppPalette( filter_t *p_filter, uint8_t *p_rgb8 )
}
}
}
}
}
}
#endif
#endif
modules/video_chroma/i420_rgb.h
View file @
14ee5e98
...
@@ -21,6 +21,10 @@
...
@@ -21,6 +21,10 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
*****************************************************************************/
#if !defined (SSE2) && !defined (MMX)
# define PLAIN
#endif
/** Number of entries in RGB palette/colormap */
/** Number of entries in RGB palette/colormap */
#define CMAP_RGB2_SIZE 256
#define CMAP_RGB2_SIZE 256
...
@@ -35,7 +39,7 @@ struct filter_sys_t
...
@@ -35,7 +39,7 @@ struct filter_sys_t
uint8_t
*
p_buffer
;
uint8_t
*
p_buffer
;
int
*
p_offset
;
int
*
p_offset
;
#ifdef
MODULE_NAME_IS_i420_rgb
#ifdef
PLAIN
/**< Pre-calculated conversion tables */
/**< Pre-calculated conversion tables */
void
*
p_base
;
/**< base for all conversion tables */
void
*
p_base
;
/**< base for all conversion tables */
uint8_t
*
p_rgb8
;
/**< RGB 8 bits table */
uint8_t
*
p_rgb8
;
/**< RGB 8 bits table */
...
@@ -55,12 +59,11 @@ struct filter_sys_t
...
@@ -55,12 +59,11 @@ struct filter_sys_t
/*****************************************************************************
/*****************************************************************************
* Prototypes
* Prototypes
*****************************************************************************/
*****************************************************************************/
#ifdef
MODULE_NAME_IS_i420_rgb
#ifdef
PLAIN
void
I420_RGB8
(
filter_t
*
,
picture_t
*
,
picture_t
*
);
void
I420_RGB8
(
filter_t
*
,
picture_t
*
,
picture_t
*
);
void
I420_RGB16_dither
(
filter_t
*
,
picture_t
*
,
picture_t
*
);
void
I420_RGB16
(
filter_t
*
,
picture_t
*
,
picture_t
*
);
void
I420_RGB16
(
filter_t
*
,
picture_t
*
,
picture_t
*
);
void
I420_RGB32
(
filter_t
*
,
picture_t
*
,
picture_t
*
);
void
I420_RGB32
(
filter_t
*
,
picture_t
*
,
picture_t
*
);
#else
// if defined(MODULE_NAME_IS_i420_rgb_mmx)
#else
void
I420_R5G5B5
(
filter_t
*
,
picture_t
*
,
picture_t
*
);
void
I420_R5G5B5
(
filter_t
*
,
picture_t
*
,
picture_t
*
);
void
I420_R5G6B5
(
filter_t
*
,
picture_t
*
,
picture_t
*
);
void
I420_R5G6B5
(
filter_t
*
,
picture_t
*
,
picture_t
*
);
void
I420_A8R8G8B8
(
filter_t
*
,
picture_t
*
,
picture_t
*
);
void
I420_A8R8G8B8
(
filter_t
*
,
picture_t
*
,
picture_t
*
);
...
...
modules/video_chroma/i420_rgb16.c
View file @
14ee5e98
This diff is collapsed.
Click to expand it.
modules/video_chroma/i420_rgb16_x86.c
0 → 100644
View file @
14ee5e98
This diff is collapsed.
Click to expand it.
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