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
1d35bcd2
Commit
1d35bcd2
authored
Oct 19, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Factorize avcodec table - spare about 5kb
parent
f70a9052
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
16 deletions
+31
-16
modules/codec/avcodec/Modules.am
modules/codec/avcodec/Modules.am
+1
-1
modules/codec/avcodec/avcodec.c
modules/codec/avcodec/avcodec.c
+0
-1
modules/codec/avcodec/avcodec.h
modules/codec/avcodec/avcodec.h
+5
-0
modules/codec/avcodec/encoder.c
modules/codec/avcodec/encoder.c
+0
-1
modules/codec/avcodec/fourcc.c
modules/codec/avcodec/fourcc.c
+25
-13
No files found.
modules/codec/avcodec/Modules.am
View file @
1d35bcd2
...
@@ -5,7 +5,7 @@ SOURCES_avcodec = \
...
@@ -5,7 +5,7 @@ SOURCES_avcodec = \
audio.c \
audio.c \
deinterlace.c \
deinterlace.c \
avutil.h \
avutil.h \
fourcc.
h
\
fourcc.
c
\
chroma.h \
chroma.h \
$(NULL)
$(NULL)
...
...
modules/codec/avcodec/avcodec.c
View file @
1d35bcd2
...
@@ -48,7 +48,6 @@
...
@@ -48,7 +48,6 @@
#endif
#endif
#include "avcodec.h"
#include "avcodec.h"
#include "fourcc.h"
#include "avutil.h"
#include "avutil.h"
/*****************************************************************************
/*****************************************************************************
...
...
modules/codec/avcodec/avcodec.h
View file @
1d35bcd2
...
@@ -21,6 +21,11 @@
...
@@ -21,6 +21,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
*****************************************************************************/
int
GetFfmpegCodec
(
vlc_fourcc_t
i_fourcc
,
int
*
pi_cat
,
int
*
pi_ffmpeg_codec
,
const
char
**
ppsz_name
);
int
GetVlcFourcc
(
int
i_ffmpeg_codec
,
int
*
pi_cat
,
vlc_fourcc_t
*
pi_fourcc
,
const
char
**
ppsz_name
);
picture_t
*
DecodeVideo
(
decoder_t
*
,
block_t
**
);
picture_t
*
DecodeVideo
(
decoder_t
*
,
block_t
**
);
aout_buffer_t
*
DecodeAudio
(
decoder_t
*
,
block_t
**
);
aout_buffer_t
*
DecodeAudio
(
decoder_t
*
,
block_t
**
);
...
...
modules/codec/avcodec/encoder.c
View file @
1d35bcd2
...
@@ -51,7 +51,6 @@
...
@@ -51,7 +51,6 @@
#include "avcodec.h"
#include "avcodec.h"
#include "chroma.h"
#include "chroma.h"
#include "fourcc.h"
#define HURRY_UP_GUARD1 (450000)
#define HURRY_UP_GUARD1 (450000)
#define HURRY_UP_GUARD2 (300000)
#define HURRY_UP_GUARD2 (300000)
...
...
modules/codec/avcodec/fourcc.
h
→
modules/codec/avcodec/fourcc.
c
View file @
1d35bcd2
/*****************************************************************************
/*****************************************************************************
* fourcc.
h
: libavcodec <-> libvlc conversion routines
* fourcc.
c
: libavcodec <-> libvlc conversion routines
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999-2008 the VideoLAN team
* Copyright (C) 1999-2008 the VideoLAN team
* $Id$
* $Id$
...
@@ -22,6 +22,22 @@
...
@@ -22,6 +22,22 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <vlc_common.h>
#include <vlc_codec.h>
#ifdef HAVE_LIBAVCODEC_AVCODEC_H
# include <libavcodec/avcodec.h>
#elif defined(HAVE_FFMPEG_AVCODEC_H)
# include <ffmpeg/avcodec.h>
#else
# include <avcodec.h>
#endif
#include "avcodec.h"
/*****************************************************************************
/*****************************************************************************
* Codec fourcc -> ffmpeg_id mapping
* Codec fourcc -> ffmpeg_id mapping
*****************************************************************************/
*****************************************************************************/
...
@@ -30,7 +46,7 @@ static const struct
...
@@ -30,7 +46,7 @@ static const struct
vlc_fourcc_t
i_fourcc
;
vlc_fourcc_t
i_fourcc
;
int
i_codec
;
int
i_codec
;
int
i_cat
;
int
i_cat
;
const
char
*
psz_name
;
const
char
psz_name
[
40
]
;
}
codecs_table
[]
=
}
codecs_table
[]
=
{
{
...
@@ -1049,15 +1065,13 @@ static const struct
...
@@ -1049,15 +1065,13 @@ static const struct
SPU_ES
,
"SubStation Alpha subtitles"
},
SPU_ES
,
"SubStation Alpha subtitles"
},
#endif
#endif
{
0
,
0
,
0
,
0
}
{
0
,
0
,
0
,
""
}
};
};
static
int
GetFfmpegCodec
(
vlc_fourcc_t
i_fourcc
,
int
*
pi_cat
,
int
GetFfmpegCodec
(
vlc_fourcc_t
i_fourcc
,
int
*
pi_cat
,
int
*
pi_ffmpeg_codec
,
const
char
**
ppsz_name
)
int
*
pi_ffmpeg_codec
,
const
char
**
ppsz_name
)
{
{
int
i
;
for
(
unsigned
i
=
0
;
codecs_table
[
i
].
i_fourcc
!=
0
;
i
++
)
for
(
i
=
0
;
codecs_table
[
i
].
i_fourcc
!=
0
;
i
++
)
{
{
if
(
codecs_table
[
i
].
i_fourcc
==
i_fourcc
)
if
(
codecs_table
[
i
].
i_fourcc
==
i_fourcc
)
{
{
...
@@ -1071,12 +1085,10 @@ static int GetFfmpegCodec( vlc_fourcc_t i_fourcc, int *pi_cat,
...
@@ -1071,12 +1085,10 @@ static int GetFfmpegCodec( vlc_fourcc_t i_fourcc, int *pi_cat,
return
false
;
return
false
;
}
}
static
int
GetVlcFourcc
(
int
i_ffmpeg_codec
,
int
*
pi_cat
,
int
GetVlcFourcc
(
int
i_ffmpeg_codec
,
int
*
pi_cat
,
vlc_fourcc_t
*
pi_fourcc
,
const
char
**
ppsz_name
)
vlc_fourcc_t
*
pi_fourcc
,
const
char
**
ppsz_name
)
{
{
int
i
;
for
(
unsigned
i
=
0
;
codecs_table
[
i
].
i_codec
!=
0
;
i
++
)
for
(
i
=
0
;
codecs_table
[
i
].
i_codec
!=
0
;
i
++
)
{
{
if
(
codecs_table
[
i
].
i_codec
==
i_ffmpeg_codec
)
if
(
codecs_table
[
i
].
i_codec
==
i_ffmpeg_codec
)
{
{
...
...
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