Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
c7c71f95
Commit
c7c71f95
authored
May 15, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace remaining PIX_FMT_* flags with AV_PIX_FMT_FLAG_*
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
ff468092
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
73 additions
and
73 deletions
+73
-73
dpxenc.c
libavcodec/dpxenc.c
+3
-3
imgconvert.c
libavcodec/imgconvert.c
+2
-2
utils.c
libavcodec/utils.c
+1
-1
lavfi.c
libavdevice/lavfi.c
+2
-2
drawutils.c
libavfilter/drawutils.c
+3
-3
formats.c
libavfilter/formats.c
+2
-2
vf_extractplanes.c
libavfilter/vf_extractplanes.c
+6
-6
vf_fade.c
libavfilter/vf_fade.c
+1
-1
vf_hflip.c
libavfilter/vf_hflip.c
+3
-3
vf_il.c
libavfilter/vf_il.c
+2
-2
vf_kerndeint.c
libavfilter/vf_kerndeint.c
+1
-1
vf_noise.c
libavfilter/vf_noise.c
+1
-1
vf_swapuv.c
libavfilter/vf_swapuv.c
+1
-1
vf_telecine.c
libavfilter/vf_telecine.c
+1
-1
vf_transpose.c
libavfilter/vf_transpose.c
+3
-3
img2enc.c
libavformat/img2enc.c
+1
-1
imgutils.c
libavutil/imgutils.c
+3
-3
pixdesc.c
libavutil/pixdesc.c
+32
-32
output.c
libswscale/output.c
+1
-1
swscale.c
libswscale/swscale.c
+2
-2
swscale_internal.h
libswscale/swscale_internal.h
+1
-1
fourcc2pixfmt.c
tools/fourcc2pixfmt.c
+1
-1
No files found.
libavcodec/dpxenc.c
View file @
c7c71f95
...
...
@@ -37,10 +37,10 @@ static av_cold int encode_init(AVCodecContext *avctx)
DPXContext
*
s
=
avctx
->
priv_data
;
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
avctx
->
pix_fmt
);
s
->
big_endian
=
!!
(
desc
->
flags
&
PIX_FMT
_BE
);
s
->
big_endian
=
!!
(
desc
->
flags
&
AV_PIX_FMT_FLAG
_BE
);
s
->
bits_per_component
=
desc
->
comp
[
0
].
depth_minus1
+
1
;
s
->
descriptor
=
(
desc
->
flags
&
PIX_FMT
_ALPHA
)
?
51
:
50
;
s
->
planar
=
!!
(
desc
->
flags
&
PIX_FMT
_PLANAR
);
s
->
descriptor
=
(
desc
->
flags
&
AV_PIX_FMT_FLAG
_ALPHA
)
?
51
:
50
;
s
->
planar
=
!!
(
desc
->
flags
&
AV_PIX_FMT_FLAG
_PLANAR
);
switch
(
avctx
->
pix_fmt
)
{
case
AV_PIX_FMT_GBRP10BE
:
...
...
libavcodec/imgconvert.c
View file @
c7c71f95
...
...
@@ -59,7 +59,7 @@
#endif
#define pixdesc_has_alpha(pixdesc) \
((pixdesc)->nb_components == 2 || (pixdesc)->nb_components == 4 || (pixdesc)->flags &
PIX_FMT
_PAL)
((pixdesc)->nb_components == 2 || (pixdesc)->nb_components == 4 || (pixdesc)->flags &
AV_PIX_FMT_FLAG
_PAL)
void
avcodec_get_chroma_sub_sample
(
enum
AVPixelFormat
pix_fmt
,
int
*
h_shift
,
int
*
v_shift
)
...
...
@@ -654,7 +654,7 @@ int main(void){
skip
=
0
;
}
av_log
(
NULL
,
AV_LOG_INFO
,
"pix fmt %s yuv_plan:%d avg_bpp:%d colortype:%d
\n
"
,
desc
->
name
,
is_yuv_planar
(
desc
),
av_get_padded_bits_per_pixel
(
desc
),
get_color_type
(
desc
));
if
((
!
(
desc
->
flags
&
PIX_FMT
_ALPHA
))
!=
(
desc
->
nb_components
!=
2
&&
desc
->
nb_components
!=
4
))
{
if
((
!
(
desc
->
flags
&
AV_PIX_FMT_FLAG
_ALPHA
))
!=
(
desc
->
nb_components
!=
2
&&
desc
->
nb_components
!=
4
))
{
av_log
(
NULL
,
AV_LOG_ERROR
,
"Alpha flag mismatch
\n
"
);
err
=
1
;
}
...
...
libavcodec/utils.c
View file @
c7c71f95
...
...
@@ -568,7 +568,7 @@ void avpriv_color_frame(AVFrame *frame, const int c[4])
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
frame
->
format
);
int
p
,
y
,
x
;
av_assert0
(
desc
->
flags
&
PIX_FMT
_PLANAR
);
av_assert0
(
desc
->
flags
&
AV_PIX_FMT_FLAG
_PLANAR
);
for
(
p
=
0
;
p
<
desc
->
nb_components
;
p
++
)
{
uint8_t
*
dst
=
frame
->
data
[
p
];
...
...
libavdevice/lavfi.c
View file @
c7c71f95
...
...
@@ -60,7 +60,7 @@ static int *create_all_formats(int n)
for
(
i
=
0
;
i
<
n
;
i
++
)
{
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
i
);
if
(
!
(
desc
->
flags
&
PIX_FMT
_HWACCEL
))
if
(
!
(
desc
->
flags
&
AV_PIX_FMT_FLAG
_HWACCEL
))
count
++
;
}
...
...
@@ -68,7 +68,7 @@ static int *create_all_formats(int n)
return
NULL
;
for
(
j
=
0
,
i
=
0
;
i
<
n
;
i
++
)
{
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
i
);
if
(
!
(
desc
->
flags
&
PIX_FMT
_HWACCEL
))
if
(
!
(
desc
->
flags
&
AV_PIX_FMT_FLAG
_HWACCEL
))
fmts
[
j
++
]
=
i
;
}
fmts
[
j
]
=
-
1
;
...
...
libavfilter/drawutils.c
View file @
c7c71f95
...
...
@@ -151,7 +151,7 @@ int ff_draw_init(FFDrawContext *draw, enum AVPixelFormat format, unsigned flags)
if
(
!
desc
->
name
)
return
AVERROR
(
EINVAL
);
if
(
desc
->
flags
&
~
(
PIX_FMT_PLANAR
|
PIX_FMT_RGB
|
PIX_FMT_PSEUDOPAL
|
PIX_FMT
_ALPHA
))
if
(
desc
->
flags
&
~
(
AV_PIX_FMT_FLAG_PLANAR
|
AV_PIX_FMT_FLAG_RGB
|
AV_PIX_FMT_FLAG_PSEUDOPAL
|
AV_PIX_FMT_FLAG
_ALPHA
))
return
AVERROR
(
ENOSYS
);
for
(
i
=
0
;
i
<
desc
->
nb_components
;
i
++
)
{
c
=
&
desc
->
comp
[
i
];
...
...
@@ -176,7 +176,7 @@ int ff_draw_init(FFDrawContext *draw, enum AVPixelFormat format, unsigned flags)
draw
->
format
=
format
;
draw
->
nb_planes
=
nb_planes
;
memcpy
(
draw
->
pixelstep
,
pixelstep
,
sizeof
(
draw
->
pixelstep
));
if
(
nb_planes
>=
3
&&
!
(
desc
->
flags
&
PIX_FMT
_RGB
))
{
if
(
nb_planes
>=
3
&&
!
(
desc
->
flags
&
AV_PIX_FMT_FLAG
_RGB
))
{
draw
->
hsub
[
1
]
=
draw
->
hsub
[
2
]
=
draw
->
hsub_max
=
desc
->
log2_chroma_w
;
draw
->
vsub
[
1
]
=
draw
->
vsub
[
2
]
=
draw
->
vsub_max
=
desc
->
log2_chroma_h
;
}
...
...
@@ -193,7 +193,7 @@ void ff_draw_color(FFDrawContext *draw, FFDrawColor *color, const uint8_t rgba[4
if
(
rgba
!=
color
->
rgba
)
memcpy
(
color
->
rgba
,
rgba
,
sizeof
(
color
->
rgba
));
if
((
draw
->
desc
->
flags
&
PIX_FMT
_RGB
)
&&
draw
->
nb_planes
==
1
&&
if
((
draw
->
desc
->
flags
&
AV_PIX_FMT_FLAG
_RGB
)
&&
draw
->
nb_planes
==
1
&&
ff_fill_rgba_map
(
rgba_map
,
draw
->
format
)
>=
0
)
{
for
(
i
=
0
;
i
<
4
;
i
++
)
color
->
comp
[
0
].
u8
[
rgba_map
[
i
]]
=
rgba
[
i
];
...
...
libavfilter/formats.c
View file @
c7c71f95
...
...
@@ -112,10 +112,10 @@ AVFilterFormats *ff_merge_formats(AVFilterFormats *a, AVFilterFormats *b,
for
(
j
=
0
;
j
<
b
->
format_count
;
j
++
)
{
const
AVPixFmtDescriptor
*
adesc
=
av_pix_fmt_desc_get
(
a
->
formats
[
i
]);
const
AVPixFmtDescriptor
*
bdesc
=
av_pix_fmt_desc_get
(
b
->
formats
[
j
]);
alpha2
|=
adesc
->
flags
&
bdesc
->
flags
&
PIX_FMT
_ALPHA
;
alpha2
|=
adesc
->
flags
&
bdesc
->
flags
&
AV_PIX_FMT_FLAG
_ALPHA
;
chroma2
|=
adesc
->
nb_components
>
1
&&
bdesc
->
nb_components
>
1
;
if
(
a
->
formats
[
i
]
==
b
->
formats
[
j
])
{
alpha1
|=
adesc
->
flags
&
PIX_FMT
_ALPHA
;
alpha1
|=
adesc
->
flags
&
AV_PIX_FMT_FLAG
_ALPHA
;
chroma1
|=
adesc
->
nb_components
>
1
;
}
}
...
...
libavfilter/vf_extractplanes.c
View file @
c7c71f95
...
...
@@ -110,11 +110,11 @@ static int query_formats(AVFilterContext *ctx)
avff
=
ctx
->
inputs
[
0
]
->
in_formats
;
desc
=
av_pix_fmt_desc_get
(
avff
->
formats
[
0
]);
depth
=
desc
->
comp
[
0
].
depth_minus1
;
be
=
desc
->
flags
&
PIX_FMT
_BE
;
be
=
desc
->
flags
&
AV_PIX_FMT_FLAG
_BE
;
for
(
i
=
1
;
i
<
avff
->
format_count
;
i
++
)
{
desc
=
av_pix_fmt_desc_get
(
avff
->
formats
[
i
]);
if
(
depth
!=
desc
->
comp
[
0
].
depth_minus1
||
be
!=
(
desc
->
flags
&
PIX_FMT
_BE
))
{
be
!=
(
desc
->
flags
&
AV_PIX_FMT_FLAG
_BE
))
{
return
AVERROR
(
EAGAIN
);
}
}
...
...
@@ -139,10 +139,10 @@ static int config_input(AVFilterLink *inlink)
int
plane_avail
,
ret
,
i
;
uint8_t
rgba_map
[
4
];
plane_avail
=
((
desc
->
flags
&
PIX_FMT
_RGB
)
?
PLANE_R
|
PLANE_G
|
PLANE_B
:
plane_avail
=
((
desc
->
flags
&
AV_PIX_FMT_FLAG
_RGB
)
?
PLANE_R
|
PLANE_G
|
PLANE_B
:
PLANE_Y
|
((
desc
->
nb_components
>
2
)
?
PLANE_U
|
PLANE_V
:
0
))
|
((
desc
->
flags
&
PIX_FMT
_ALPHA
)
?
PLANE_A
:
0
);
((
desc
->
flags
&
AV_PIX_FMT_FLAG
_ALPHA
)
?
PLANE_A
:
0
);
if
(
e
->
requested_planes
&
~
plane_avail
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Requested planes not available.
\n
"
);
return
AVERROR
(
EINVAL
);
...
...
@@ -152,8 +152,8 @@ static int config_input(AVFilterLink *inlink)
e
->
depth
=
(
desc
->
comp
[
0
].
depth_minus1
+
1
)
>>
3
;
e
->
step
=
av_get_padded_bits_per_pixel
(
desc
)
>>
3
;
e
->
is_packed_rgb
=
!
(
desc
->
flags
&
PIX_FMT
_PLANAR
);
if
(
desc
->
flags
&
PIX_FMT
_RGB
)
{
e
->
is_packed_rgb
=
!
(
desc
->
flags
&
AV_PIX_FMT_FLAG
_PLANAR
);
if
(
desc
->
flags
&
AV_PIX_FMT_FLAG
_RGB
)
{
ff_fill_rgba_map
(
rgba_map
,
inlink
->
format
);
for
(
i
=
0
;
i
<
4
;
i
++
)
e
->
map
[
i
]
=
rgba_map
[
e
->
map
[
i
]];
...
...
libavfilter/vf_fade.c
View file @
c7c71f95
...
...
@@ -127,7 +127,7 @@ static int config_props(AVFilterLink *inlink)
fade
->
vsub
=
pixdesc
->
log2_chroma_h
;
fade
->
bpp
=
av_get_bits_per_pixel
(
pixdesc
)
>>
3
;
fade
->
alpha
&=
pixdesc
->
flags
&
PIX_FMT
_ALPHA
;
fade
->
alpha
&=
pixdesc
->
flags
&
AV_PIX_FMT_FLAG
_ALPHA
;
fade
->
is_packed_rgb
=
ff_fill_rgba_map
(
fade
->
rgba_map
,
inlink
->
format
)
>=
0
;
/* use CCIR601/709 black level for studio-level pixel non-alpha components */
...
...
libavfilter/vf_hflip.c
View file @
c7c71f95
...
...
@@ -47,8 +47,8 @@ static int query_formats(AVFilterContext *ctx)
for
(
fmt
=
0
;
fmt
<
AV_PIX_FMT_NB
;
fmt
++
)
{
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
fmt
);
if
(
!
(
desc
->
flags
&
PIX_FMT
_HWACCEL
||
desc
->
flags
&
PIX_FMT
_BITSTREAM
||
if
(
!
(
desc
->
flags
&
AV_PIX_FMT_FLAG
_HWACCEL
||
desc
->
flags
&
AV_PIX_FMT_FLAG
_BITSTREAM
||
(
desc
->
log2_chroma_w
!=
desc
->
log2_chroma_h
&&
desc
->
comp
[
0
].
plane
==
desc
->
comp
[
1
].
plane
)))
ff_add_format
(
&
pix_fmts
,
fmt
);
...
...
@@ -87,7 +87,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
av_frame_copy_props
(
out
,
in
);
/* copy palette if required */
if
(
av_pix_fmt_desc_get
(
inlink
->
format
)
->
flags
&
PIX_FMT
_PAL
)
if
(
av_pix_fmt_desc_get
(
inlink
->
format
)
->
flags
&
AV_PIX_FMT_FLAG
_PAL
)
memcpy
(
out
->
data
[
1
],
in
->
data
[
1
],
AVPALETTE_SIZE
);
for
(
plane
=
0
;
plane
<
4
&&
in
->
data
[
plane
];
plane
++
)
{
...
...
libavfilter/vf_il.c
View file @
c7c71f95
...
...
@@ -88,7 +88,7 @@ static int query_formats(AVFilterContext *ctx)
for
(
fmt
=
0
;
fmt
<
AV_PIX_FMT_NB
;
fmt
++
)
{
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
fmt
);
if
(
!
(
desc
->
flags
&
PIX_FMT_PAL
)
&&
!
(
desc
->
flags
&
PIX_FMT
_HWACCEL
))
if
(
!
(
desc
->
flags
&
AV_PIX_FMT_FLAG_PAL
)
&&
!
(
desc
->
flags
&
AV_PIX_FMT_FLAG
_HWACCEL
))
ff_add_format
(
&
formats
,
fmt
);
}
...
...
@@ -106,7 +106,7 @@ static int config_input(AVFilterLink *inlink)
il
->
nb_planes
=
FFMAX
(
il
->
nb_planes
,
desc
->
comp
[
i
].
plane
);
il
->
nb_planes
++
;
il
->
has_alpha
=
!!
(
desc
->
flags
&
PIX_FMT
_ALPHA
);
il
->
has_alpha
=
!!
(
desc
->
flags
&
AV_PIX_FMT_FLAG
_ALPHA
);
if
((
ret
=
av_image_fill_linesizes
(
il
->
linesize
,
inlink
->
format
,
inlink
->
w
))
<
0
)
return
ret
;
...
...
libavfilter/vf_kerndeint.c
View file @
c7c71f95
...
...
@@ -89,7 +89,7 @@ static int config_props(AVFilterLink *inlink)
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
inlink
->
format
);
int
ret
;
kerndeint
->
is_packed_rgb
=
av_pix_fmt_desc_get
(
inlink
->
format
)
->
flags
&
PIX_FMT
_RGB
;
kerndeint
->
is_packed_rgb
=
av_pix_fmt_desc_get
(
inlink
->
format
)
->
flags
&
AV_PIX_FMT_FLAG
_RGB
;
kerndeint
->
vsub
=
desc
->
log2_chroma_h
;
ret
=
av_image_alloc
(
kerndeint
->
tmp_data
,
kerndeint
->
tmp_linesize
,
...
...
libavfilter/vf_noise.c
View file @
c7c71f95
...
...
@@ -172,7 +172,7 @@ static int query_formats(AVFilterContext *ctx)
for
(
fmt
=
0
;
fmt
<
AV_PIX_FMT_NB
;
fmt
++
)
{
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
fmt
);
if
(
desc
->
flags
&
PIX_FMT
_PLANAR
&&
!
((
desc
->
comp
[
0
].
depth_minus1
+
1
)
&
7
))
if
(
desc
->
flags
&
AV_PIX_FMT_FLAG
_PLANAR
&&
!
((
desc
->
comp
[
0
].
depth_minus1
+
1
)
&
7
))
ff_add_format
(
&
formats
,
fmt
);
}
...
...
libavfilter/vf_swapuv.c
View file @
c7c71f95
...
...
@@ -54,7 +54,7 @@ static int is_planar_yuv(const AVPixFmtDescriptor *desc)
{
int
i
;
if
(
desc
->
flags
&
~
(
PIX_FMT_BE
|
PIX_FMT_PLANAR
|
PIX_FMT
_ALPHA
)
||
if
(
desc
->
flags
&
~
(
AV_PIX_FMT_FLAG_BE
|
AV_PIX_FMT_FLAG_PLANAR
|
AV_PIX_FMT_FLAG
_ALPHA
)
||
desc
->
nb_components
<
3
||
(
desc
->
comp
[
1
].
depth_minus1
!=
desc
->
comp
[
2
].
depth_minus1
))
return
0
;
...
...
libavfilter/vf_telecine.c
View file @
c7c71f95
...
...
@@ -103,7 +103,7 @@ static int query_formats(AVFilterContext *ctx)
for
(
fmt
=
0
;
fmt
<
AV_PIX_FMT_NB
;
fmt
++
)
{
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
fmt
);
if
(
!
(
desc
->
flags
&
PIX_FMT
_HWACCEL
))
if
(
!
(
desc
->
flags
&
AV_PIX_FMT_FLAG
_HWACCEL
))
ff_add_format
(
&
pix_fmts
,
fmt
);
}
...
...
libavfilter/vf_transpose.c
View file @
c7c71f95
...
...
@@ -67,9 +67,9 @@ static int query_formats(AVFilterContext *ctx)
for
(
fmt
=
0
;
fmt
<
AV_PIX_FMT_NB
;
fmt
++
)
{
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
fmt
);
if
(
!
(
desc
->
flags
&
PIX_FMT
_PAL
||
desc
->
flags
&
PIX_FMT
_HWACCEL
||
desc
->
flags
&
PIX_FMT
_BITSTREAM
||
if
(
!
(
desc
->
flags
&
AV_PIX_FMT_FLAG
_PAL
||
desc
->
flags
&
AV_PIX_FMT_FLAG
_HWACCEL
||
desc
->
flags
&
AV_PIX_FMT_FLAG
_BITSTREAM
||
desc
->
log2_chroma_w
!=
desc
->
log2_chroma_h
))
ff_add_format
(
&
pix_fmts
,
fmt
);
}
...
...
libavformat/img2enc.c
View file @
c7c71f95
...
...
@@ -60,7 +60,7 @@ static int write_header(AVFormatContext *s)
&&
s
->
nb_streams
==
1
&&
st
->
codec
->
codec_id
==
AV_CODEC_ID_RAWVIDEO
&&
desc
&&
(
desc
->
flags
&
PIX_FMT
_PLANAR
)
&&
(
desc
->
flags
&
AV_PIX_FMT_FLAG
_PLANAR
)
&&
desc
->
nb_components
>=
3
;
return
0
;
}
...
...
libavutil/imgutils.c
View file @
c7c71f95
...
...
@@ -76,7 +76,7 @@ int av_image_get_linesize(enum AVPixelFormat pix_fmt, int width, int plane)
int
max_step
[
4
];
/* max pixel step for each plane */
int
max_step_comp
[
4
];
/* the component for each plane which has the max pixel step */
if
((
unsigned
)
pix_fmt
>=
AV_PIX_FMT_NB
||
desc
->
flags
&
PIX_FMT
_HWACCEL
)
if
((
unsigned
)
pix_fmt
>=
AV_PIX_FMT_NB
||
desc
->
flags
&
AV_PIX_FMT_FLAG
_HWACCEL
)
return
AVERROR
(
EINVAL
);
av_image_fill_max_pixsteps
(
max_step
,
max_step_comp
,
desc
);
...
...
@@ -324,7 +324,7 @@ int av_image_get_buffer_size(enum AVPixelFormat pix_fmt, int width, int height,
return
AVERROR
(
EINVAL
);
if
(
av_image_check_size
(
width
,
height
,
0
,
NULL
)
<
0
)
return
AVERROR
(
EINVAL
);
if
(
desc
->
flags
&
PIX_FMT
_PSEUDOPAL
)
if
(
desc
->
flags
&
AV_PIX_FMT_FLAG
_PSEUDOPAL
)
// do not include palette for these pseudo-paletted formats
return
width
*
height
;
return
av_image_fill_arrays
(
data
,
linesize
,
NULL
,
pix_fmt
,
width
,
height
,
align
);
...
...
@@ -358,7 +358,7 @@ int av_image_copy_to_buffer(uint8_t *dst, int dst_size,
}
}
if
(
desc
->
flags
&
PIX_FMT
_PAL
)
{
if
(
desc
->
flags
&
AV_PIX_FMT_FLAG
_PAL
)
{
uint32_t
*
d32
=
(
uint32_t
*
)(((
size_t
)
dst
+
3
)
&
~
3
);
for
(
i
=
0
;
i
<
256
;
i
++
)
AV_WL32
(
d32
+
i
,
AV_RN32
(
src_data
[
1
]
+
4
*
i
));
...
...
libavutil/pixdesc.c
View file @
c7c71f95
...
...
@@ -233,7 +233,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.
comp
=
{
{
0
,
0
,
1
,
0
,
7
},
/* Y */
},
.
flags
=
PIX_FMT
_PSEUDOPAL
,
.
flags
=
AV_PIX_FMT_FLAG
_PSEUDOPAL
,
},
[
AV_PIX_FMT_MONOWHITE
]
=
{
.
name
=
"monow"
,
...
...
@@ -489,7 +489,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
{
0
,
3
,
3
,
0
,
7
},
/* G */
{
0
,
3
,
4
,
0
,
7
},
/* B */
},
.
flags
=
PIX_FMT
_RGB
,
.
flags
=
AV_PIX_FMT_FLAG
_RGB
,
},
[
AV_PIX_FMT_RGB0
]
=
{
.
name
=
"rgb0"
,
...
...
@@ -501,7 +501,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
{
0
,
3
,
2
,
0
,
7
},
/* G */
{
0
,
3
,
3
,
0
,
7
},
/* B */
},
.
flags
=
PIX_FMT
_RGB
,
.
flags
=
AV_PIX_FMT_FLAG
_RGB
,
},
[
AV_PIX_FMT_0BGR
]
=
{
.
name
=
"0bgr"
,
...
...
@@ -513,7 +513,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
{
0
,
3
,
3
,
0
,
7
},
/* G */
{
0
,
3
,
2
,
0
,
7
},
/* B */
},
.
flags
=
PIX_FMT
_RGB
,
.
flags
=
AV_PIX_FMT_FLAG
_RGB
,
},
[
AV_PIX_FMT_BGR0
]
=
{
.
name
=
"bgr0"
,
...
...
@@ -525,7 +525,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
{
0
,
3
,
2
,
0
,
7
},
/* G */
{
0
,
3
,
1
,
0
,
7
},
/* B */
},
.
flags
=
PIX_FMT
_RGB
,
.
flags
=
AV_PIX_FMT_FLAG
_RGB
,
},
[
AV_PIX_FMT_GRAY16BE
]
=
{
.
name
=
"gray16be"
,
...
...
@@ -914,7 +914,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
{
0
,
7
,
5
,
0
,
15
},
/* B */
{
0
,
7
,
7
,
0
,
15
},
/* A */
},
.
flags
=
PIX_FMT_RGB
|
PIX_FMT_BE
|
PIX_FMT
_ALPHA
,
.
flags
=
AV_PIX_FMT_FLAG_RGB
|
AV_PIX_FMT_FLAG_BE
|
AV_PIX_FMT_FLAG
_ALPHA
,
},
[
AV_PIX_FMT_RGBA64LE
]
=
{
.
name
=
"rgba64le"
,
...
...
@@ -927,7 +927,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
{
0
,
7
,
5
,
0
,
15
},
/* B */
{
0
,
7
,
7
,
0
,
15
},
/* A */
},
.
flags
=
PIX_FMT_RGB
|
PIX_FMT
_ALPHA
,
.
flags
=
AV_PIX_FMT_FLAG_RGB
|
AV_PIX_FMT_FLAG
_ALPHA
,
},
[
AV_PIX_FMT_RGB565BE
]
=
{
.
name
=
"rgb565be"
,
...
...
@@ -1036,7 +1036,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
{
0
,
7
,
1
,
0
,
15
},
/* B */
{
0
,
7
,
7
,
0
,
15
},
/* A */
},
.
flags
=
PIX_FMT_BE
|
PIX_FMT_RGB
|
PIX_FMT
_ALPHA
,
.
flags
=
AV_PIX_FMT_FLAG_BE
|
AV_PIX_FMT_FLAG_RGB
|
AV_PIX_FMT_FLAG
_ALPHA
,
},
[
AV_PIX_FMT_BGRA64LE
]
=
{
.
name
=
"bgra64le"
,
...
...
@@ -1049,7 +1049,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
{
0
,
7
,
1
,
0
,
15
},
/* B */
{
0
,
7
,
7
,
0
,
15
},
/* A */
},
.
flags
=
PIX_FMT_RGB
|
PIX_FMT
_ALPHA
,
.
flags
=
AV_PIX_FMT_FLAG_RGB
|
AV_PIX_FMT_FLAG
_ALPHA
,
},
[
AV_PIX_FMT_BGR565BE
]
=
{
.
name
=
"bgr565be"
,
...
...
@@ -1199,7 +1199,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
{
1
,
1
,
1
,
0
,
11
},
/* U */
{
2
,
1
,
1
,
0
,
11
},
/* V */
},
.
flags
=
PIX_FMT
_PLANAR
,
.
flags
=
AV_PIX_FMT_FLAG
_PLANAR
,
},
[
AV_PIX_FMT_YUV420P12BE
]
=
{
.
name
=
"yuv420p12be"
,
...
...
@@ -1211,7 +1211,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
{
1
,
1
,
1
,
0
,
11
},
/* U */
{
2
,
1
,
1
,
0
,
11
},
/* V */
},
.
flags
=
PIX_FMT_BE
|
PIX_FMT
_PLANAR
,
.
flags
=
AV_PIX_FMT_FLAG_BE
|
AV_PIX_FMT_FLAG
_PLANAR
,
},
[
AV_PIX_FMT_YUV420P14LE
]
=
{
.
name
=
"yuv420p14le"
,
...
...
@@ -1223,7 +1223,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
{
1
,
1
,
1
,
0
,
13
},
/* U */
{
2
,
1
,
1
,
0
,
13
},
/* V */
},
.
flags
=
PIX_FMT
_PLANAR
,
.
flags
=
AV_PIX_FMT_FLAG
_PLANAR
,
},
[
AV_PIX_FMT_YUV420P14BE
]
=
{
.
name
=
"yuv420p14be"
,
...
...
@@ -1235,7 +1235,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
{
1
,
1
,
1
,
0
,
13
},
/* U */
{
2
,
1
,
1
,
0
,
13
},
/* V */
},
.
flags
=
PIX_FMT_BE
|
PIX_FMT
_PLANAR
,
.
flags
=
AV_PIX_FMT_FLAG_BE
|
AV_PIX_FMT_FLAG
_PLANAR
,
},
[
AV_PIX_FMT_YUV420P16LE
]
=
{
.
name
=
"yuv420p16le"
,
...
...
@@ -1319,7 +1319,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
{
1
,
1
,
1
,
0
,
11
},
/* U */
{
2
,
1
,
1
,
0
,
11
},
/* V */
},
.
flags
=
PIX_FMT
_PLANAR
,
.
flags
=
AV_PIX_FMT_FLAG
_PLANAR
,
},
[
AV_PIX_FMT_YUV422P12BE
]
=
{
.
name
=
"yuv422p12be"
,
...
...
@@ -1331,7 +1331,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
{
1
,
1
,
1
,
0
,
11
},
/* U */
{
2
,
1
,
1
,
0
,
11
},
/* V */
},
.
flags
=
PIX_FMT_BE
|
PIX_FMT
_PLANAR
,
.
flags
=
AV_PIX_FMT_FLAG_BE
|
AV_PIX_FMT_FLAG
_PLANAR
,
},
[
AV_PIX_FMT_YUV422P14LE
]
=
{
.
name
=
"yuv422p14le"
,
...
...
@@ -1343,7 +1343,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
{
1
,
1
,
1
,
0
,
13
},
/* U */
{
2
,
1
,
1
,
0
,
13
},
/* V */
},
.
flags
=
PIX_FMT
_PLANAR
,
.
flags
=
AV_PIX_FMT_FLAG
_PLANAR
,
},
[
AV_PIX_FMT_YUV422P14BE
]
=
{
.
name
=
"yuv422p14be"
,
...
...
@@ -1355,7 +1355,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
{
1
,
1
,
1
,
0
,
13
},
/* U */
{
2
,
1
,
1
,
0
,
13
},
/* V */
},
.
flags
=
PIX_FMT_BE
|
PIX_FMT
_PLANAR
,
.
flags
=
AV_PIX_FMT_FLAG_BE
|
AV_PIX_FMT_FLAG
_PLANAR
,
},
[
AV_PIX_FMT_YUV422P16LE
]
=
{
.
name
=
"yuv422p16le"
,
...
...
@@ -1463,7 +1463,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
{
1
,
1
,
1
,
0
,
11
},
/* U */
{
2
,
1
,
1
,
0
,
11
},
/* V */
},
.
flags
=
PIX_FMT
_PLANAR
,
.
flags
=
AV_PIX_FMT_FLAG
_PLANAR
,
},
[
AV_PIX_FMT_YUV444P12BE
]
=
{
.
name
=
"yuv444p12be"
,
...
...
@@ -1475,7 +1475,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
{
1
,
1
,
1
,
0
,
11
},
/* U */
{
2
,
1
,
1
,
0
,
11
},
/* V */
},
.
flags
=
PIX_FMT_BE
|
PIX_FMT
_PLANAR
,
.
flags
=
AV_PIX_FMT_FLAG_BE
|
AV_PIX_FMT_FLAG
_PLANAR
,
},
[
AV_PIX_FMT_YUV444P14LE
]
=
{
.
name
=
"yuv444p14le"
,
...
...
@@ -1487,7 +1487,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
{
1
,
1
,
1
,
0
,
13
},
/* U */
{
2
,
1
,
1
,
0
,
13
},
/* V */
},
.
flags
=
PIX_FMT
_PLANAR
,
.
flags
=
AV_PIX_FMT_FLAG
_PLANAR
,
},
[
AV_PIX_FMT_YUV444P14BE
]
=
{
.
name
=
"yuv444p14be"
,
...
...
@@ -1499,7 +1499,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
{
1
,
1
,
1
,
0
,
13
},
/* U */
{
2
,
1
,
1
,
0
,
13
},
/* V */
},
.
flags
=
PIX_FMT_BE
|
PIX_FMT
_PLANAR
,
.
flags
=
AV_PIX_FMT_FLAG_BE
|
AV_PIX_FMT_FLAG
_PLANAR
,
},
[
AV_PIX_FMT_DXVA2_VLD
]
=
{
.
name
=
"dxva2_vld"
,
...
...
@@ -1511,7 +1511,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.
name
=
"vda_vld"
,
.
log2_chroma_w
=
1
,
.
log2_chroma_h
=
1
,
.
flags
=
PIX_FMT
_HWACCEL
,
.
flags
=
AV_PIX_FMT_FLAG
_HWACCEL
,
},
[
AV_PIX_FMT_GRAY8A
]
=
{
.
name
=
"gray8a"
,
...
...
@@ -1580,7 +1580,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
{
0
,
1
,
1
,
0
,
9
},
/* G */
{
1
,
1
,
1
,
0
,
9
},
/* B */
},
.
flags
=
PIX_FMT_BE
|
PIX_FMT_PLANAR
|
PIX_FMT
_RGB
,
.
flags
=
AV_PIX_FMT_FLAG_BE
|
AV_PIX_FMT_FLAG_PLANAR
|
AV_PIX_FMT_FLAG
_RGB
,
},
[
AV_PIX_FMT_GBRP12LE
]
=
{
.
name
=
"gbrp12le"
,
...
...
@@ -1592,7 +1592,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
{
0
,
1
,
1
,
0
,
11
},
/* G */
{
1
,
1
,
1
,
0
,
11
},
/* B */
},
.
flags
=
PIX_FMT_PLANAR
|
PIX_FMT
_RGB
,
.
flags
=
AV_PIX_FMT_FLAG_PLANAR
|
AV_PIX_FMT_FLAG
_RGB
,
},
[
AV_PIX_FMT_GBRP12BE
]
=
{
.
name
=
"gbrp12be"
,
...
...
@@ -1604,7 +1604,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
{
0
,
1
,
1
,
0
,
11
},
/* G */
{
1
,
1
,
1
,
0
,
11
},
/* B */
},
.
flags
=
PIX_FMT_BE
|
PIX_FMT_PLANAR
|
PIX_FMT
_RGB
,
.
flags
=
AV_PIX_FMT_FLAG_BE
|
AV_PIX_FMT_FLAG_PLANAR
|
AV_PIX_FMT_FLAG
_RGB
,
},
[
AV_PIX_FMT_GBRP14LE
]
=
{
.
name
=
"gbrp14le"
,
...
...
@@ -1616,7 +1616,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
{
0
,
1
,
1
,
0
,
13
},
/* G */
{
1
,
1
,
1
,
0
,
13
},
/* B */
},
.
flags
=
PIX_FMT_PLANAR
|
PIX_FMT
_RGB
,
.
flags
=
AV_PIX_FMT_FLAG_PLANAR
|
AV_PIX_FMT_FLAG
_RGB
,
},
[
AV_PIX_FMT_GBRP14BE
]
=
{
.
name
=
"gbrp14be"
,
...
...
@@ -1665,7 +1665,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
{
1
,
0
,
1
,
0
,
7
},
/* B */
{
3
,
0
,
1
,
0
,
7
},
/* A */
},
.
flags
=
PIX_FMT_PLANAR
|
PIX_FMT_RGB
|
PIX_FMT
_ALPHA
,
.
flags
=
AV_PIX_FMT_FLAG_PLANAR
|
AV_PIX_FMT_FLAG_RGB
|
AV_PIX_FMT_FLAG
_ALPHA
,
},
[
AV_PIX_FMT_GBRAP16LE
]
=
{
.
name
=
"gbrap16le"
,
...
...
@@ -1678,7 +1678,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
{
1
,
1
,
1
,
0
,
15
},
/* B */
{
3
,
1
,
1
,
0
,
15
},
/* A */
},
.
flags
=
PIX_FMT_PLANAR
|
PIX_FMT_RGB
|
PIX_FMT
_ALPHA
,
.
flags
=
AV_PIX_FMT_FLAG_PLANAR
|
AV_PIX_FMT_FLAG_RGB
|
AV_PIX_FMT_FLAG
_ALPHA
,
},
[
AV_PIX_FMT_GBRAP16BE
]
=
{
.
name
=
"gbrap16be"
,
...
...
@@ -1691,7 +1691,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
{
1
,
1
,
1
,
0
,
15
},
/* B */
{
3
,
1
,
1
,
0
,
15
},
/* A */
},
.
flags
=
PIX_FMT_BE
|
PIX_FMT_PLANAR
|
PIX_FMT_RGB
|
PIX_FMT
_ALPHA
,
.
flags
=
AV_PIX_FMT_FLAG_BE
|
AV_PIX_FMT_FLAG_PLANAR
|
AV_PIX_FMT_FLAG_RGB
|
AV_PIX_FMT_FLAG
_ALPHA
,
},
[
AV_PIX_FMT_VDPAU
]
=
{
.
name
=
"vdpau"
,
...
...
@@ -1795,7 +1795,7 @@ int av_get_padded_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
for
(
c
=
0
;
c
<
4
;
c
++
)
bits
+=
steps
[
c
];
if
(
!
(
pixdesc
->
flags
&
PIX_FMT
_BITSTREAM
))
if
(
!
(
pixdesc
->
flags
&
AV_PIX_FMT_FLAG
_BITSTREAM
))
bits
*=
8
;
return
bits
>>
log2_pixels
;
...
...
@@ -1887,7 +1887,7 @@ void ff_check_pixfmt_descriptors(void){
av_assert0
(
d
->
log2_chroma_h
<=
3
);
av_assert0
(
d
->
nb_components
<=
4
);
av_assert0
(
d
->
name
&&
d
->
name
[
0
]);
av_assert0
((
d
->
nb_components
==
4
||
d
->
nb_components
==
2
)
==
!!
(
d
->
flags
&
PIX_FMT
_ALPHA
));
av_assert0
((
d
->
nb_components
==
4
||
d
->
nb_components
==
2
)
==
!!
(
d
->
flags
&
AV_PIX_FMT_FLAG
_ALPHA
));
av_assert2
(
av_get_pix_fmt
(
d
->
name
)
==
i
);
for
(
j
=
0
;
j
<
FF_ARRAY_ELEMS
(
d
->
comp
);
j
++
)
{
...
...
@@ -1896,7 +1896,7 @@ void ff_check_pixfmt_descriptors(void){
av_assert0
(
!
c
->
plane
&&
!
c
->
step_minus1
&&
!
c
->
offset_plus1
&&
!
c
->
shift
&&
!
c
->
depth_minus1
);
continue
;
}
if
(
d
->
flags
&
PIX_FMT
_BITSTREAM
)
{
if
(
d
->
flags
&
AV_PIX_FMT_FLAG
_BITSTREAM
)
{
av_assert0
(
c
->
step_minus1
>=
c
->
depth_minus1
);
}
else
{
av_assert0
(
8
*
(
c
->
step_minus1
+
1
)
>=
c
->
depth_minus1
+
1
);
...
...
libswscale/output.c
View file @
c7c71f95
...
...
@@ -1717,7 +1717,7 @@ yuv2gbrp_full_X_c(SwsContext *c, const int16_t *lumFilter,
{
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
c
->
dstFormat
);
int
i
;
int
hasAlpha
=
(
desc
->
flags
&
PIX_FMT
_ALPHA
)
&&
alpSrc
;
int
hasAlpha
=
(
desc
->
flags
&
AV_PIX_FMT_FLAG
_ALPHA
)
&&
alpSrc
;
uint16_t
**
dest16
=
(
uint16_t
**
)
dest
;
int
SH
=
22
+
7
-
desc
->
comp
[
0
].
depth_minus1
;
int
A
=
0
;
// init to silence warning
...
...
libswscale/swscale.c
View file @
c7c71f95
...
...
@@ -804,7 +804,7 @@ static void xyz12Torgb48(struct SwsContext *c, uint16_t *dst,
for
(
xp
=
0
;
xp
+
2
<
stride
;
xp
+=
3
)
{
int
x
,
y
,
z
,
r
,
g
,
b
;
if
(
desc
->
flags
&
PIX_FMT
_BE
)
{
if
(
desc
->
flags
&
AV_PIX_FMT_FLAG
_BE
)
{
x
=
AV_RB16
(
src
+
xp
+
0
);
y
=
AV_RB16
(
src
+
xp
+
1
);
z
=
AV_RB16
(
src
+
xp
+
2
);
...
...
@@ -835,7 +835,7 @@ static void xyz12Torgb48(struct SwsContext *c, uint16_t *dst,
b
=
av_clip_c
(
b
,
0
,
4095
);
// convert from sRGBlinear to RGB and scale from 12bit to 16bit
if
(
desc
->
flags
&
PIX_FMT
_BE
)
{
if
(
desc
->
flags
&
AV_PIX_FMT_FLAG
_BE
)
{
AV_WB16
(
dst
+
xp
+
0
,
c
->
rgbgamma
[
r
]
<<
4
);
AV_WB16
(
dst
+
xp
+
1
,
c
->
rgbgamma
[
g
]
<<
4
);
AV_WB16
(
dst
+
xp
+
2
,
c
->
rgbgamma
[
b
]
<<
4
);
...
...
libswscale/swscale_internal.h
View file @
c7c71f95
...
...
@@ -742,7 +742,7 @@ static av_always_inline int isALPHA(enum AVPixelFormat pix_fmt)
{
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
pix_fmt
);
av_assert0
(
desc
);
return
desc
->
flags
&
PIX_FMT
_ALPHA
;
return
desc
->
flags
&
AV_PIX_FMT_FLAG
_ALPHA
;
}
#if 1
...
...
tools/fourcc2pixfmt.c
View file @
c7c71f95
...
...
@@ -102,7 +102,7 @@ int main(int argc, char **argv)
if
(
list_pix_fmt_fourccs
)
{
for
(
i
=
0
;
i
<
AV_PIX_FMT_NB
;
i
++
)
{
const
AVPixFmtDescriptor
*
pix_desc
=
av_pix_fmt_desc_get
(
i
);
if
(
!
pix_desc
->
name
||
pix_desc
->
flags
&
PIX_FMT
_HWACCEL
)
if
(
!
pix_desc
->
name
||
pix_desc
->
flags
&
AV_PIX_FMT_FLAG
_HWACCEL
)
continue
;
printf
(
"%s: "
,
pix_desc
->
name
);
print_pix_fmt_fourccs
(
i
,
' '
);
...
...
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