Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
9aee7d49
Commit
9aee7d49
authored
Jan 04, 2013
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec: cleanup chroma helper prototypes
Avoid passing a structure on the stack.
parent
e313dedf
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
15 deletions
+15
-15
modules/codec/avcodec/chroma.c
modules/codec/avcodec/chroma.c
+7
-7
modules/codec/avcodec/chroma.h
modules/codec/avcodec/chroma.h
+3
-3
modules/codec/avcodec/deinterlace.c
modules/codec/avcodec/deinterlace.c
+1
-1
modules/codec/avcodec/encoder.c
modules/codec/avcodec/encoder.c
+2
-2
modules/video_filter/swscale.c
modules/video_filter/swscale.c
+2
-2
No files found.
modules/codec/avcodec/chroma.c
View file @
9aee7d49
...
@@ -122,7 +122,7 @@ static const struct
...
@@ -122,7 +122,7 @@ static const struct
{
0
,
0
,
0
,
0
,
0
}
{
0
,
0
,
0
,
0
,
0
}
};
};
int
TestFfmpegChroma
(
const
int
i_ffmpeg_id
,
const
vlc_fourcc_t
i_vlc_fourcc
)
int
TestFfmpegChroma
(
int
i_ffmpeg_id
,
vlc_fourcc_t
i_vlc_fourcc
)
{
{
for
(
int
i
=
0
;
chroma_table
[
i
].
i_chroma
!=
0
;
i
++
)
for
(
int
i
=
0
;
chroma_table
[
i
].
i_chroma
!=
0
;
i
++
)
{
{
...
@@ -133,18 +133,18 @@ int TestFfmpegChroma( const int i_ffmpeg_id, const vlc_fourcc_t i_vlc_fourcc )
...
@@ -133,18 +133,18 @@ int TestFfmpegChroma( const int i_ffmpeg_id, const vlc_fourcc_t i_vlc_fourcc )
}
}
/* FIXME special case the RGB formats */
/* FIXME special case the RGB formats */
int
GetFfmpegChroma
(
int
*
i_ffmpeg_chroma
,
const
video_format_t
fmt
)
int
GetFfmpegChroma
(
int
*
restrict
i_ffmpeg_chroma
,
const
video_format_t
*
fmt
)
{
{
for
(
int
i
=
0
;
chroma_table
[
i
].
i_chroma
!=
0
;
i
++
)
for
(
int
i
=
0
;
chroma_table
[
i
].
i_chroma
!=
0
;
i
++
)
{
{
if
(
chroma_table
[
i
].
i_chroma
==
fmt
.
i_chroma
)
if
(
chroma_table
[
i
].
i_chroma
==
fmt
->
i_chroma
)
{
{
if
(
(
chroma_table
[
i
].
i_rmask
==
0
&&
if
(
(
chroma_table
[
i
].
i_rmask
==
0
&&
chroma_table
[
i
].
i_gmask
==
0
&&
chroma_table
[
i
].
i_gmask
==
0
&&
chroma_table
[
i
].
i_bmask
==
0
)
||
chroma_table
[
i
].
i_bmask
==
0
)
||
(
chroma_table
[
i
].
i_rmask
==
fmt
.
i_rmask
&&
(
chroma_table
[
i
].
i_rmask
==
fmt
->
i_rmask
&&
chroma_table
[
i
].
i_gmask
==
fmt
.
i_gmask
&&
chroma_table
[
i
].
i_gmask
==
fmt
->
i_gmask
&&
chroma_table
[
i
].
i_bmask
==
fmt
.
i_bmask
)
)
chroma_table
[
i
].
i_bmask
==
fmt
->
i_bmask
)
)
{
{
*
i_ffmpeg_chroma
=
chroma_table
[
i
].
i_chroma_id
;
*
i_ffmpeg_chroma
=
chroma_table
[
i
].
i_chroma_id
;
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
...
@@ -154,7 +154,7 @@ int GetFfmpegChroma( int *i_ffmpeg_chroma, const video_format_t fmt )
...
@@ -154,7 +154,7 @@ int GetFfmpegChroma( int *i_ffmpeg_chroma, const video_format_t fmt )
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
int
GetVlcChroma
(
video_format_t
*
fmt
,
const
int
i_ffmpeg_chroma
)
int
GetVlcChroma
(
video_format_t
*
fmt
,
int
i_ffmpeg_chroma
)
{
{
/* TODO FIXME for rgb format we HAVE to set rgb mask/shift */
/* TODO FIXME for rgb format we HAVE to set rgb mask/shift */
for
(
int
i
=
0
;
chroma_table
[
i
].
i_chroma
!=
0
;
i
++
)
for
(
int
i
=
0
;
chroma_table
[
i
].
i_chroma
!=
0
;
i
++
)
...
...
modules/codec/avcodec/chroma.h
View file @
9aee7d49
...
@@ -26,8 +26,8 @@
...
@@ -26,8 +26,8 @@
#ifndef _VLC_AVUTIL_CHROMA_H
#ifndef _VLC_AVUTIL_CHROMA_H
#define _VLC_AVUTIL_CHROMA_H 1
#define _VLC_AVUTIL_CHROMA_H 1
int
TestFfmpegChroma
(
const
int
i_ffmpeg_id
,
const
vlc_fourcc_t
i_vlc_fourcc
);
int
TestFfmpegChroma
(
int
i_ffmpeg_id
,
vlc_fourcc_t
i_vlc_fourcc
);
int
GetFfmpegChroma
(
int
*
i_ffmpeg_chroma
,
const
video_format_t
fmt
);
int
GetFfmpegChroma
(
int
*
i_ffmpeg_chroma
,
const
video_format_t
*
fmt
);
int
GetVlcChroma
(
video_format_t
*
fmt
,
const
int
i_ffmpeg_chroma
);
int
GetVlcChroma
(
video_format_t
*
fmt
,
int
i_ffmpeg_chroma
);
#endif
#endif
modules/codec/avcodec/deinterlace.c
View file @
9aee7d49
...
@@ -85,7 +85,7 @@ int OpenDeinterlace( vlc_object_t *p_this )
...
@@ -85,7 +85,7 @@ int OpenDeinterlace( vlc_object_t *p_this )
/* Misc init */
/* Misc init */
p_filter
->
fmt_in
.
video
.
i_chroma
=
p_filter
->
fmt_in
.
i_codec
;
p_filter
->
fmt_in
.
video
.
i_chroma
=
p_filter
->
fmt_in
.
i_codec
;
if
(
GetFfmpegChroma
(
&
p_sys
->
i_src_ffmpeg_chroma
,
p_filter
->
fmt_in
.
video
)
!=
VLC_SUCCESS
)
if
(
GetFfmpegChroma
(
&
p_sys
->
i_src_ffmpeg_chroma
,
&
p_filter
->
fmt_in
.
video
)
!=
VLC_SUCCESS
)
{
{
msg_Err
(
p_filter
,
"Failed to match chroma type"
);
msg_Err
(
p_filter
,
"Failed to match chroma type"
);
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
...
...
modules/codec/avcodec/encoder.c
View file @
9aee7d49
...
@@ -464,7 +464,7 @@ int OpenEncoder( vlc_object_t *p_this )
...
@@ -464,7 +464,7 @@ int OpenEncoder( vlc_object_t *p_this )
p_enc
->
fmt_in
.
i_codec
=
VLC_CODEC_I420
;
p_enc
->
fmt_in
.
i_codec
=
VLC_CODEC_I420
;
p_enc
->
fmt_in
.
video
.
i_chroma
=
p_enc
->
fmt_in
.
i_codec
;
p_enc
->
fmt_in
.
video
.
i_chroma
=
p_enc
->
fmt_in
.
i_codec
;
GetFfmpegChroma
(
&
p_context
->
pix_fmt
,
p_enc
->
fmt_in
.
video
);
GetFfmpegChroma
(
&
p_context
->
pix_fmt
,
&
p_enc
->
fmt_in
.
video
);
if
(
p_codec
->
pix_fmts
)
if
(
p_codec
->
pix_fmts
)
{
{
...
@@ -682,7 +682,7 @@ int OpenEncoder( vlc_object_t *p_this )
...
@@ -682,7 +682,7 @@ int OpenEncoder( vlc_object_t *p_this )
{
{
/* XXX: hack: Force same codec (will be handled by transcode) */
/* XXX: hack: Force same codec (will be handled by transcode) */
p_enc
->
fmt_in
.
video
.
i_chroma
=
p_enc
->
fmt_in
.
i_codec
=
p_enc
->
fmt_out
.
i_codec
;
p_enc
->
fmt_in
.
video
.
i_chroma
=
p_enc
->
fmt_in
.
i_codec
=
p_enc
->
fmt_out
.
i_codec
;
GetFfmpegChroma
(
&
p_context
->
pix_fmt
,
p_enc
->
fmt_in
.
video
);
GetFfmpegChroma
(
&
p_context
->
pix_fmt
,
&
p_enc
->
fmt_in
.
video
);
}
}
/* Make sure we get extradata filled by the encoder */
/* Make sure we get extradata filled by the encoder */
...
...
modules/video_filter/swscale.c
View file @
9aee7d49
...
@@ -293,8 +293,8 @@ static int GetParameters( ScalerConfiguration *p_cfg,
...
@@ -293,8 +293,8 @@ static int GetParameters( ScalerConfiguration *p_cfg,
bool
b_swap_uvi
=
false
;
bool
b_swap_uvi
=
false
;
bool
b_swap_uvo
=
false
;
bool
b_swap_uvo
=
false
;
GetFfmpegChroma
(
&
i_fmti
,
*
p_fmti
);
GetFfmpegChroma
(
&
i_fmti
,
p_fmti
);
GetFfmpegChroma
(
&
i_fmto
,
*
p_fmto
);
GetFfmpegChroma
(
&
i_fmto
,
p_fmto
);
if
(
p_fmti
->
i_chroma
==
p_fmto
->
i_chroma
)
if
(
p_fmti
->
i_chroma
==
p_fmto
->
i_chroma
)
{
{
...
...
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