Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
e6c4ac7b
F
Ffmpeg
项目概览
小白菜888
/
Ffmpeg
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
Ffmpeg
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e6c4ac7b
编写于
5月 12, 2013
作者:
A
Anton Khirnov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
pixdesc: rename PIX_FMT_* flags to AV_PIX_FMT_FLAG_*
上级
7c57a582
变更
23
展开全部
隐藏空白更改
内联
并排
Showing
23 changed file
with
214 addition
and
178 deletion
+214
-178
cmdutils.c
cmdutils.c
+5
-5
doc/APIchanges
doc/APIchanges
+3
-0
libavcodec/avpicture.c
libavcodec/avpicture.c
+2
-2
libavcodec/ffv1dec.c
libavcodec/ffv1dec.c
+1
-1
libavcodec/ffv1enc.c
libavcodec/ffv1enc.c
+1
-1
libavcodec/imgconvert.c
libavcodec/imgconvert.c
+6
-6
libavcodec/pnm.c
libavcodec/pnm.c
+1
-1
libavcodec/rawdec.c
libavcodec/rawdec.c
+3
-3
libavcodec/tiffenc.c
libavcodec/tiffenc.c
+2
-2
libavcodec/utils.c
libavcodec/utils.c
+2
-2
libavcodec/xwdenc.c
libavcodec/xwdenc.c
+1
-1
libavfilter/formats.c
libavfilter/formats.c
+1
-1
libavfilter/vf_crop.c
libavfilter/vf_crop.c
+1
-1
libavfilter/vf_fieldorder.c
libavfilter/vf_fieldorder.c
+2
-2
libavfilter/vf_pixdesctest.c
libavfilter/vf_pixdesctest.c
+2
-2
libavfilter/vf_scale.c
libavfilter/vf_scale.c
+2
-2
libavutil/frame.c
libavutil/frame.c
+1
-1
libavutil/imgutils.c
libavutil/imgutils.c
+10
-10
libavutil/pixdesc.c
libavutil/pixdesc.c
+112
-112
libavutil/pixdesc.h
libavutil/pixdesc.h
+42
-9
libavutil/version.h
libavutil/version.h
+2
-2
libswscale/swscale_internal.h
libswscale/swscale_internal.h
+11
-11
libswscale/swscale_unscaled.c
libswscale/swscale_unscaled.c
+1
-1
未找到文件。
cmdutils.c
浏览文件 @
e6c4ac7b
...
...
@@ -1161,11 +1161,11 @@ int show_pix_fmts(void *optctx, const char *opt, const char *arg)
while
((
pix_desc
=
av_pix_fmt_desc_next
(
pix_desc
)))
{
enum
AVPixelFormat
pix_fmt
=
av_pix_fmt_desc_get_id
(
pix_desc
);
printf
(
"%c%c%c%c%c %-16s %d %2d
\n
"
,
sws_isSupportedInput
(
pix_fmt
)
?
'I'
:
'.'
,
sws_isSupportedOutput
(
pix_fmt
)
?
'O'
:
'.'
,
pix_desc
->
flags
&
PIX_FMT
_HWACCEL
?
'H'
:
'.'
,
pix_desc
->
flags
&
PIX_FMT
_PAL
?
'P'
:
'.'
,
pix_desc
->
flags
&
PIX_FMT
_BITSTREAM
?
'B'
:
'.'
,
sws_isSupportedInput
(
pix_fmt
)
?
'I'
:
'.'
,
sws_isSupportedOutput
(
pix_fmt
)
?
'O'
:
'.'
,
pix_desc
->
flags
&
AV_PIX_FMT_FLAG
_HWACCEL
?
'H'
:
'.'
,
pix_desc
->
flags
&
AV_PIX_FMT_FLAG
_PAL
?
'P'
:
'.'
,
pix_desc
->
flags
&
AV_PIX_FMT_FLAG
_BITSTREAM
?
'B'
:
'.'
,
pix_desc
->
name
,
pix_desc
->
nb_components
,
av_get_bits_per_pixel
(
pix_desc
));
...
...
doc/APIchanges
浏览文件 @
e6c4ac7b
...
...
@@ -13,6 +13,9 @@ libavutil: 2012-10-22
API changes, most recent first:
2013-05-xx - xxxxxxx - lavu 52.11.0 - pixdesc.h
Replace PIX_FMT_* flags with AV_PIX_FMT_FLAG_*.
2013-04-xx - xxxxxxx - lavc 55.4.0 - avcodec.h
Add field_order to AVCodecParserContext.
...
...
libavcodec/avpicture.c
浏览文件 @
e6c4ac7b
...
...
@@ -75,7 +75,7 @@ int avpicture_layout(const AVPicture* src, enum AVPixelFormat pix_fmt,
}
}
if
(
desc
->
flags
&
PIX_FMT
_PAL
)
if
(
desc
->
flags
&
AV_PIX_FMT_FLAG
_PAL
)
memcpy
((
unsigned
char
*
)(((
size_t
)
dest
+
3
)
&
~
3
),
src
->
data
[
1
],
256
*
4
);
...
...
@@ -92,7 +92,7 @@ int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height)
return
AVERROR
(
EINVAL
);
if
((
ret
=
av_image_check_size
(
width
,
height
,
0
,
NULL
))
<
0
)
return
ret
;
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
avpicture_fill
(
&
dummy_pict
,
NULL
,
pix_fmt
,
width
,
height
);
...
...
libavcodec/ffv1dec.c
浏览文件 @
e6c4ac7b
...
...
@@ -335,7 +335,7 @@ static int decode_slice(AVCodecContext *c, void *arg)
FFV1Context
*
fs
=
*
(
void
**
)
arg
;
FFV1Context
*
f
=
fs
->
avctx
->
priv_data
;
int
width
,
height
,
x
,
y
,
ret
;
const
int
ps
=
(
av_pix_fmt_desc_get
(
c
->
pix_fmt
)
->
flags
&
PIX_FMT
_PLANAR
)
const
int
ps
=
(
av_pix_fmt_desc_get
(
c
->
pix_fmt
)
->
flags
&
AV_PIX_FMT_FLAG
_PLANAR
)
?
(
c
->
bits_per_raw_sample
>
8
)
+
1
:
4
;
AVFrame
*
const
p
=
f
->
cur
;
...
...
libavcodec/ffv1enc.c
浏览文件 @
e6c4ac7b
...
...
@@ -875,7 +875,7 @@ static int encode_slice(AVCodecContext *c, void *arg)
int
x
=
fs
->
slice_x
;
int
y
=
fs
->
slice_y
;
AVFrame
*
const
p
=
&
f
->
picture
;
const
int
ps
=
(
av_pix_fmt_desc_get
(
c
->
pix_fmt
)
->
flags
&
PIX_FMT
_PLANAR
)
const
int
ps
=
(
av_pix_fmt_desc_get
(
c
->
pix_fmt
)
->
flags
&
AV_PIX_FMT_FLAG
_PLANAR
)
?
(
f
->
bits_per_raw_sample
>
8
)
+
1
:
4
;
...
...
libavcodec/imgconvert.c
浏览文件 @
e6c4ac7b
...
...
@@ -60,7 +60,7 @@ void avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int
static
int
is_gray
(
const
AVPixFmtDescriptor
*
desc
)
{
return
desc
->
nb_components
-
(
desc
->
flags
&
PIX_FMT
_ALPHA
)
==
1
;
return
desc
->
nb_components
-
(
desc
->
flags
&
AV_PIX_FMT_FLAG
_ALPHA
)
==
1
;
}
int
avcodec_get_pix_fmt_loss
(
enum
AVPixelFormat
dst_pix_fmt
,
...
...
@@ -86,11 +86,11 @@ int avcodec_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt,
dst_desc
->
log2_chroma_h
>
src_desc
->
log2_chroma_h
)
loss
|=
FF_LOSS_RESOLUTION
;
if
((
src_desc
->
flags
&
PIX_FMT_RGB
)
!=
(
dst_desc
->
flags
&
PIX_FMT
_RGB
))
if
((
src_desc
->
flags
&
AV_PIX_FMT_FLAG_RGB
)
!=
(
dst_desc
->
flags
&
AV_PIX_FMT_FLAG
_RGB
))
loss
|=
FF_LOSS_COLORSPACE
;
if
(
has_alpha
&&
!
(
dst_desc
->
flags
&
PIX_FMT
_ALPHA
)
&&
(
dst_desc
->
flags
&
PIX_FMT
_ALPHA
))
if
(
has_alpha
&&
!
(
dst_desc
->
flags
&
AV_PIX_FMT_FLAG
_ALPHA
)
&&
(
dst_desc
->
flags
&
AV_PIX_FMT_FLAG
_ALPHA
))
loss
|=
FF_LOSS_ALPHA
;
if
(
dst_pix_fmt
==
AV_PIX_FMT_PAL8
&&
!
is_gray
(
src_desc
))
...
...
@@ -260,8 +260,8 @@ void ff_shrink88(uint8_t *dst, int dst_wrap,
/* return true if yuv planar */
static
inline
int
is_yuv_planar
(
const
AVPixFmtDescriptor
*
desc
)
{
return
(
!
(
desc
->
flags
&
PIX_FMT
_RGB
)
&&
(
desc
->
flags
&
PIX_FMT
_PLANAR
));
return
(
!
(
desc
->
flags
&
AV_PIX_FMT_FLAG
_RGB
)
&&
(
desc
->
flags
&
AV_PIX_FMT_FLAG
_PLANAR
));
}
int
av_picture_crop
(
AVPicture
*
dst
,
const
AVPicture
*
src
,
...
...
libavcodec/pnm.c
浏览文件 @
e6c4ac7b
...
...
@@ -173,7 +173,7 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s)
}
else
s
->
maxval
=
1
;
/* more check if YUV420 */
if
(
av_pix_fmt_desc_get
(
avctx
->
pix_fmt
)
->
flags
&
PIX_FMT
_PLANAR
)
{
if
(
av_pix_fmt_desc_get
(
avctx
->
pix_fmt
)
->
flags
&
AV_PIX_FMT_FLAG
_PLANAR
)
{
if
((
avctx
->
width
&
1
)
!=
0
)
return
AVERROR_INVALIDDATA
;
h
=
(
avctx
->
height
*
2
);
...
...
libavcodec/rawdec.c
浏览文件 @
e6c4ac7b
...
...
@@ -98,11 +98,11 @@ static av_cold int raw_init_decoder(AVCodecContext *avctx)
return
AVERROR
(
EINVAL
);
}
if
(
desc
->
flags
&
(
PIX_FMT_PAL
|
PIX_FMT
_PSEUDOPAL
))
{
if
(
desc
->
flags
&
(
AV_PIX_FMT_FLAG_PAL
|
AV_PIX_FMT_FLAG
_PSEUDOPAL
))
{
context
->
palette
=
av_buffer_alloc
(
AVPALETTE_SIZE
);
if
(
!
context
->
palette
)
return
AVERROR
(
ENOMEM
);
if
(
desc
->
flags
&
PIX_FMT
_PSEUDOPAL
)
if
(
desc
->
flags
&
AV_PIX_FMT_FLAG
_PSEUDOPAL
)
avpriv_set_systematic_pal2
((
uint32_t
*
)
context
->
palette
->
data
,
avctx
->
pix_fmt
);
else
memset
(
context
->
palette
->
data
,
0
,
AVPALETTE_SIZE
);
...
...
@@ -210,7 +210,7 @@ static int raw_decode(AVCodecContext *avctx, void *data, int *got_frame,
}
if
((
avctx
->
pix_fmt
==
AV_PIX_FMT_PAL8
&&
buf_size
<
context
->
frame_size
)
||
(
desc
->
flags
&
PIX_FMT
_PSEUDOPAL
))
{
(
desc
->
flags
&
AV_PIX_FMT_FLAG
_PSEUDOPAL
))
{
frame
->
buf
[
1
]
=
av_buffer_ref
(
context
->
palette
);
if
(
!
frame
->
buf
[
1
])
return
AVERROR
(
ENOMEM
);
...
...
libavcodec/tiffenc.c
浏览文件 @
e6c4ac7b
...
...
@@ -242,9 +242,9 @@ static int encode_frame(AVCodecContext * avctx, AVPacket *pkt,
case
AV_PIX_FMT_PAL8
:
pfd
=
av_pix_fmt_desc_get
(
avctx
->
pix_fmt
);
s
->
bpp
=
av_get_bits_per_pixel
(
pfd
);
if
(
pfd
->
flags
&
PIX_FMT
_PAL
)
{
if
(
pfd
->
flags
&
AV_PIX_FMT_FLAG
_PAL
)
{
s
->
photometric_interpretation
=
3
;
}
else
if
(
pfd
->
flags
&
PIX_FMT
_RGB
)
{
}
else
if
(
pfd
->
flags
&
AV_PIX_FMT_FLAG
_RGB
)
{
s
->
photometric_interpretation
=
2
;
}
else
{
s
->
photometric_interpretation
=
1
;
...
...
libavcodec/utils.c
浏览文件 @
e6c4ac7b
...
...
@@ -663,7 +663,7 @@ do { \
planes
=
av_pix_fmt_count_planes
(
frame
->
format
);
/* workaround for AVHWAccel plane count of 0, buf[0] is used as
check for allocated buffers: make libavcodec happy */
if
(
desc
&&
desc
->
flags
&
PIX_FMT
_HWACCEL
)
if
(
desc
&&
desc
->
flags
&
AV_PIX_FMT_FLAG
_HWACCEL
)
planes
=
1
;
if
(
!
desc
||
planes
<=
0
)
{
ret
=
AVERROR
(
EINVAL
);
...
...
@@ -793,7 +793,7 @@ int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2,
static
int
is_hwaccel_pix_fmt
(
enum
AVPixelFormat
pix_fmt
)
{
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
pix_fmt
);
return
desc
->
flags
&
PIX_FMT
_HWACCEL
;
return
desc
->
flags
&
AV_PIX_FMT_FLAG
_HWACCEL
;
}
enum
AVPixelFormat
avcodec_default_get_format
(
struct
AVCodecContext
*
s
,
const
enum
AVPixelFormat
*
fmt
)
...
...
libavcodec/xwdenc.c
浏览文件 @
e6c4ac7b
...
...
@@ -51,7 +51,7 @@ static int xwd_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
uint8_t
*
ptr
,
*
buf
;
pixdepth
=
av_get_bits_per_pixel
(
desc
);
if
(
desc
->
flags
&
PIX_FMT
_BE
)
if
(
desc
->
flags
&
AV_PIX_FMT_FLAG
_BE
)
be
=
1
;
switch
(
pix_fmt
)
{
case
AV_PIX_FMT_ARGB
:
...
...
libavfilter/formats.c
浏览文件 @
e6c4ac7b
...
...
@@ -216,7 +216,7 @@ AVFilterFormats *ff_all_formats(enum AVMediaType type)
for
(
fmt
=
0
;
fmt
<
num_formats
;
fmt
++
)
{
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
fmt
);
if
((
type
!=
AVMEDIA_TYPE_VIDEO
)
||
(
type
==
AVMEDIA_TYPE_VIDEO
&&
!
(
desc
->
flags
&
PIX_FMT
_HWACCEL
)))
(
type
==
AVMEDIA_TYPE_VIDEO
&&
!
(
desc
->
flags
&
AV_PIX_FMT_FLAG
_HWACCEL
)))
ff_add_format
(
&
ret
,
fmt
);
}
...
...
libavfilter/vf_crop.c
浏览文件 @
e6c4ac7b
...
...
@@ -261,7 +261,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame)
frame
->
data
[
0
]
+=
crop
->
y
*
frame
->
linesize
[
0
];
frame
->
data
[
0
]
+=
crop
->
x
*
crop
->
max_step
[
0
];
if
(
!
(
desc
->
flags
&
PIX_FMT_PAL
||
desc
->
flags
&
PIX_FMT
_PSEUDOPAL
))
{
if
(
!
(
desc
->
flags
&
AV_PIX_FMT_FLAG_PAL
||
desc
->
flags
&
AV_PIX_FMT_FLAG
_PSEUDOPAL
))
{
for
(
i
=
1
;
i
<
3
;
i
++
)
{
if
(
frame
->
data
[
i
])
{
frame
->
data
[
i
]
+=
(
crop
->
y
>>
crop
->
vsub
)
*
frame
->
linesize
[
i
];
...
...
libavfilter/vf_fieldorder.c
浏览文件 @
e6c4ac7b
...
...
@@ -56,8 +56,8 @@ static int query_formats(AVFilterContext *ctx)
formats
=
NULL
;
for
(
pix_fmt
=
0
;
pix_fmt
<
AV_PIX_FMT_NB
;
pix_fmt
++
)
{
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
pix_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
->
nb_components
&&
!
desc
->
log2_chroma_h
&&
(
ret
=
ff_add_format
(
&
formats
,
pix_fmt
))
<
0
)
{
ff_formats_unref
(
&
formats
);
...
...
libavfilter/vf_pixdesctest.c
浏览文件 @
e6c4ac7b
...
...
@@ -78,8 +78,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
}
/* copy palette */
if
(
priv
->
pix_desc
->
flags
&
PIX_FMT
_PAL
||
priv
->
pix_desc
->
flags
&
PIX_FMT
_PSEUDOPAL
)
if
(
priv
->
pix_desc
->
flags
&
AV_PIX_FMT_FLAG
_PAL
||
priv
->
pix_desc
->
flags
&
AV_PIX_FMT_FLAG
_PSEUDOPAL
)
memcpy
(
out
->
data
[
1
],
in
->
data
[
1
],
256
*
4
);
for
(
c
=
0
;
c
<
priv
->
pix_desc
->
nb_components
;
c
++
)
{
...
...
libavfilter/vf_scale.c
浏览文件 @
e6c4ac7b
...
...
@@ -220,8 +220,8 @@ static int config_props(AVFilterLink *outlink)
outlink
->
w
,
outlink
->
h
,
av_get_pix_fmt_name
(
outlink
->
format
),
scale
->
flags
);
scale
->
input_is_pal
=
desc
->
flags
&
PIX_FMT
_PAL
||
desc
->
flags
&
PIX_FMT
_PSEUDOPAL
;
scale
->
input_is_pal
=
desc
->
flags
&
AV_PIX_FMT_FLAG
_PAL
||
desc
->
flags
&
AV_PIX_FMT_FLAG
_PSEUDOPAL
;
if
(
scale
->
sws
)
sws_freeContext
(
scale
->
sws
);
...
...
libavutil/frame.c
浏览文件 @
e6c4ac7b
...
...
@@ -93,7 +93,7 @@ static int get_video_buffer(AVFrame *frame, int align)
frame
->
data
[
i
]
=
frame
->
buf
[
i
]
->
data
;
}
if
(
desc
->
flags
&
PIX_FMT_PAL
||
desc
->
flags
&
PIX_FMT
_PSEUDOPAL
)
{
if
(
desc
->
flags
&
AV_PIX_FMT_FLAG_PAL
||
desc
->
flags
&
AV_PIX_FMT_FLAG
_PSEUDOPAL
)
{
av_buffer_unref
(
&
frame
->
buf
[
1
]);
frame
->
buf
[
1
]
=
av_buffer_alloc
(
1024
);
if
(
!
frame
->
buf
[
1
])
...
...
libavutil/imgutils.c
浏览文件 @
e6c4ac7b
...
...
@@ -55,7 +55,7 @@ int av_image_get_linesize(enum AVPixelFormat pix_fmt, int width, int plane)
if
(
!
desc
)
return
AVERROR
(
EINVAL
);
if
(
desc
->
flags
&
PIX_FMT
_BITSTREAM
)
if
(
desc
->
flags
&
AV_PIX_FMT_FLAG
_BITSTREAM
)
return
(
width
*
(
desc
->
comp
[
0
].
step_minus1
+
1
)
+
7
)
>>
3
;
av_image_fill_max_pixsteps
(
max_step
,
max_step_comp
,
desc
);
...
...
@@ -72,10 +72,10 @@ int av_image_fill_linesizes(int linesizes[4], enum AVPixelFormat pix_fmt, int wi
memset
(
linesizes
,
0
,
4
*
sizeof
(
linesizes
[
0
]));
if
(
!
desc
||
desc
->
flags
&
PIX_FMT
_HWACCEL
)
if
(
!
desc
||
desc
->
flags
&
AV_PIX_FMT_FLAG
_HWACCEL
)
return
AVERROR
(
EINVAL
);
if
(
desc
->
flags
&
PIX_FMT
_BITSTREAM
)
{
if
(
desc
->
flags
&
AV_PIX_FMT_FLAG
_BITSTREAM
)
{
if
(
width
>
(
INT_MAX
-
7
)
/
(
desc
->
comp
[
0
].
step_minus1
+
1
))
return
AVERROR
(
EINVAL
);
linesizes
[
0
]
=
(
width
*
(
desc
->
comp
[
0
].
step_minus1
+
1
)
+
7
)
>>
3
;
...
...
@@ -102,7 +102,7 @@ int av_image_fill_pointers(uint8_t *data[4], enum AVPixelFormat pix_fmt, int hei
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
pix_fmt
);
memset
(
data
,
0
,
sizeof
(
data
[
0
])
*
4
);
if
(
!
desc
||
desc
->
flags
&
PIX_FMT
_HWACCEL
)
if
(
!
desc
||
desc
->
flags
&
AV_PIX_FMT_FLAG
_HWACCEL
)
return
AVERROR
(
EINVAL
);
data
[
0
]
=
ptr
;
...
...
@@ -110,8 +110,8 @@ int av_image_fill_pointers(uint8_t *data[4], enum AVPixelFormat pix_fmt, int hei
return
AVERROR
(
EINVAL
);
size
[
0
]
=
linesizes
[
0
]
*
height
;
if
(
desc
->
flags
&
PIX_FMT
_PAL
||
desc
->
flags
&
PIX_FMT
_PSEUDOPAL
)
{
if
(
desc
->
flags
&
AV_PIX_FMT_FLAG
_PAL
||
desc
->
flags
&
AV_PIX_FMT_FLAG
_PSEUDOPAL
)
{
size
[
0
]
=
(
size
[
0
]
+
3
)
&
~
3
;
data
[
1
]
=
ptr
+
size
[
0
];
/* palette is stored here as 256 32 bits words */
return
size
[
0
]
+
256
*
4
;
...
...
@@ -203,7 +203,7 @@ int av_image_alloc(uint8_t *pointers[4], int linesizes[4],
av_free
(
buf
);
return
ret
;
}
if
(
desc
->
flags
&
PIX_FMT_PAL
||
desc
->
flags
&
PIX_FMT
_PSEUDOPAL
)
if
(
desc
->
flags
&
AV_PIX_FMT_FLAG_PAL
||
desc
->
flags
&
AV_PIX_FMT_FLAG
_PSEUDOPAL
)
avpriv_set_systematic_pal2
((
uint32_t
*
)
pointers
[
1
],
pix_fmt
);
return
ret
;
...
...
@@ -247,11 +247,11 @@ void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],
{
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
pix_fmt
);
if
(
!
desc
||
desc
->
flags
&
PIX_FMT
_HWACCEL
)
if
(
!
desc
||
desc
->
flags
&
AV_PIX_FMT_FLAG
_HWACCEL
)
return
;
if
(
desc
->
flags
&
PIX_FMT
_PAL
||
desc
->
flags
&
PIX_FMT
_PSEUDOPAL
)
{
if
(
desc
->
flags
&
AV_PIX_FMT_FLAG
_PAL
||
desc
->
flags
&
AV_PIX_FMT_FLAG
_PSEUDOPAL
)
{
av_image_copy_plane
(
dst_data
[
0
],
dst_linesizes
[
0
],
src_data
[
0
],
src_linesizes
[
0
],
width
,
height
);
...
...
libavutil/pixdesc.c
浏览文件 @
e6c4ac7b
此差异已折叠。
点击以展开。
libavutil/pixdesc.h
浏览文件 @
e6c4ac7b
...
...
@@ -83,21 +83,54 @@ typedef struct AVPixFmtDescriptor{
AVComponentDescriptor
comp
[
4
];
}
AVPixFmtDescriptor
;
#define PIX_FMT_BE 1 ///< Pixel format is big-endian.
#define PIX_FMT_PAL 2 ///< Pixel format has a palette in data[1], values are indexes in this palette.
#define PIX_FMT_BITSTREAM 4 ///< All values of a component are bit-wise packed end to end.
#define PIX_FMT_HWACCEL 8 ///< Pixel format is an HW accelerated format.
#define PIX_FMT_PLANAR 16 ///< At least one pixel component is not in the first data plane
#define PIX_FMT_RGB 32 ///< The pixel format contains RGB-like data (as opposed to YUV/grayscale)
/**
* Pixel format is big-endian.
*/
#define AV_PIX_FMT_FLAG_BE (1 << 0)
/**
* Pixel format has a palette in data[1], values are indexes in this palette.
*/
#define AV_PIX_FMT_FLAG_PAL (1 << 1)
/**
* All values of a component are bit-wise packed end to end.
*/
#define AV_PIX_FMT_FLAG_BITSTREAM (1 << 2)
/**
* Pixel format is an HW accelerated format.
*/
#define AV_PIX_FMT_FLAG_HWACCEL (1 << 3)
/**
* At least one pixel component is not in the first data plane.
*/
#define AV_PIX_FMT_FLAG_PLANAR (1 << 4)
/**
* The pixel format contains RGB-like data (as opposed to YUV/grayscale).
*/
#define AV_PIX_FMT_FLAG_RGB (1 << 5)
/**
* The pixel format is "pseudo-paletted". This means that Libav treats it as
* paletted internally, but the palette is generated by the decoder and is not
* stored in the file.
*/
#define PIX_FMT_PSEUDOPAL 64
#define PIX_FMT_ALPHA 128 ///< The pixel format has an alpha channel
#define AV_PIX_FMT_FLAG_PSEUDOPAL (1 << 6)
/**
* The pixel format has an alpha channel.
*/
#define AV_PIX_FMT_FLAG_ALPHA (1 << 7)
#if FF_API_PIX_FMT
/**
* @deprecate use the AV_PIX_FMT_FLAG_* flags
*/
#define PIX_FMT_BE AV_PIX_FMT_FLAG_BE
#define PIX_FMT_PAL AV_PIX_FMT_FLAG_PAL
#define PIX_FMT_BITSTREAM AV_PIX_FMT_FLAG_BITSTREAM
#define PIX_FMT_HWACCEL AV_PIX_FMT_FLAG_HWACCEL
#define PIX_FMT_PLANAR AV_PIX_FMT_FLAG_PLANAR
#define PIX_FMT_RGB AV_PIX_FMT_FLAG_RGB
#define PIX_FMT_PSEUDOPAL AV_PIX_FMT_FLAG_PSEUDOPAL
#define PIX_FMT_ALPHA AV_PIX_FMT_FLAG_ALPHA
#endif
#if FF_API_PIX_FMT_DESC
/**
...
...
libavutil/version.h
浏览文件 @
e6c4ac7b
...
...
@@ -37,8 +37,8 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 52
#define LIBAVUTIL_VERSION_MINOR 1
0
#define LIBAVUTIL_VERSION_MICRO
1
#define LIBAVUTIL_VERSION_MINOR 1
1
#define LIBAVUTIL_VERSION_MICRO
0
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
LIBAVUTIL_VERSION_MINOR, \
...
...
libswscale/swscale_internal.h
浏览文件 @
e6c4ac7b
...
...
@@ -596,33 +596,33 @@ static av_always_inline int isBE(enum AVPixelFormat pix_fmt)
{
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
pix_fmt
);
av_assert0
(
desc
);
return
desc
->
flags
&
PIX_FMT
_BE
;
return
desc
->
flags
&
AV_PIX_FMT_FLAG
_BE
;
}
static
av_always_inline
int
isYUV
(
enum
AVPixelFormat
pix_fmt
)
{
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
pix_fmt
);
av_assert0
(
desc
);
return
!
(
desc
->
flags
&
PIX_FMT
_RGB
)
&&
desc
->
nb_components
>=
2
;
return
!
(
desc
->
flags
&
AV_PIX_FMT_FLAG
_RGB
)
&&
desc
->
nb_components
>=
2
;
}
static
av_always_inline
int
isPlanarYUV
(
enum
AVPixelFormat
pix_fmt
)
{
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
pix_fmt
);
av_assert0
(
desc
);
return
((
desc
->
flags
&
PIX_FMT
_PLANAR
)
&&
isYUV
(
pix_fmt
));
return
((
desc
->
flags
&
AV_PIX_FMT_FLAG
_PLANAR
)
&&
isYUV
(
pix_fmt
));
}
static
av_always_inline
int
isRGB
(
enum
AVPixelFormat
pix_fmt
)
{
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
pix_fmt
);
av_assert0
(
desc
);
return
(
desc
->
flags
&
PIX_FMT
_RGB
);
return
(
desc
->
flags
&
AV_PIX_FMT_FLAG
_RGB
);
}
#if 0 // FIXME
#define isGray(x) \
(!(av_pix_fmt_descriptors[x].flags &
PIX_FMT
_PAL) && \
(!(av_pix_fmt_descriptors[x].flags &
AV_PIX_FMT_FLAG
_PAL) && \
av_pix_fmt_descriptors[x].nb_components <= 2)
#else
#define isGray(x) \
...
...
@@ -683,7 +683,7 @@ static av_always_inline int isPacked(enum AVPixelFormat pix_fmt)
{
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
pix_fmt
);
av_assert0
(
desc
);
return
((
desc
->
nb_components
>=
2
&&
!
(
desc
->
flags
&
PIX_FMT
_PLANAR
))
||
return
((
desc
->
nb_components
>=
2
&&
!
(
desc
->
flags
&
AV_PIX_FMT_FLAG
_PLANAR
))
||
pix_fmt
==
AV_PIX_FMT_PAL8
);
}
...
...
@@ -691,29 +691,29 @@ static av_always_inline int isPlanar(enum AVPixelFormat pix_fmt)
{
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
pix_fmt
);
av_assert0
(
desc
);
return
(
desc
->
nb_components
>=
2
&&
(
desc
->
flags
&
PIX_FMT
_PLANAR
));
return
(
desc
->
nb_components
>=
2
&&
(
desc
->
flags
&
AV_PIX_FMT_FLAG
_PLANAR
));
}
static
av_always_inline
int
isPackedRGB
(
enum
AVPixelFormat
pix_fmt
)
{
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
pix_fmt
);
av_assert0
(
desc
);
return
((
desc
->
flags
&
(
PIX_FMT_PLANAR
|
PIX_FMT_RGB
))
==
PIX_FMT
_RGB
);
return
((
desc
->
flags
&
(
AV_PIX_FMT_FLAG_PLANAR
|
AV_PIX_FMT_FLAG_RGB
))
==
AV_PIX_FMT_FLAG
_RGB
);
}
static
av_always_inline
int
isPlanarRGB
(
enum
AVPixelFormat
pix_fmt
)
{
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
pix_fmt
);
av_assert0
(
desc
);
return
((
desc
->
flags
&
(
PIX_FMT_PLANAR
|
PIX_FMT
_RGB
))
==
(
PIX_FMT_PLANAR
|
PIX_FMT
_RGB
));
return
((
desc
->
flags
&
(
AV_PIX_FMT_FLAG_PLANAR
|
AV_PIX_FMT_FLAG
_RGB
))
==
(
AV_PIX_FMT_FLAG_PLANAR
|
AV_PIX_FMT_FLAG
_RGB
));
}
static
av_always_inline
int
usePal
(
enum
AVPixelFormat
pix_fmt
)
{
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
pix_fmt
);
av_assert0
(
desc
);
return
((
desc
->
flags
&
PIX_FMT_PAL
)
||
(
desc
->
flags
&
PIX_FMT
_PSEUDOPAL
)
||
return
((
desc
->
flags
&
AV_PIX_FMT_FLAG_PAL
)
||
(
desc
->
flags
&
AV_PIX_FMT_FLAG
_PSEUDOPAL
)
||
pix_fmt
==
AV_PIX_FMT_Y400A
);
}
...
...
libswscale/swscale_unscaled.c
浏览文件 @
e6c4ac7b
...
...
@@ -563,7 +563,7 @@ static rgbConvFn findRgbConvFn(SwsContext *c)
#define IS_NOT_NE(bpp, desc) \
(((bpp + 7) >> 3) == 2 && \
(!(desc->flags &
PIX_FMT
_BE) != !HAVE_BIGENDIAN))
(!(desc->flags &
AV_PIX_FMT_FLAG
_BE) != !HAVE_BIGENDIAN))
/* if this is non-native rgb444/555/565, don't handle it here. */
if
(
IS_NOT_NE
(
srcId
,
desc_src
)
||
IS_NOT_NE
(
dstId
,
desc_dst
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录