Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
2bb6eba2
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,发现更多精彩内容 >>
提交
2bb6eba2
编写于
1月 17, 2009
作者:
A
Aurelien Jacobs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove ff_get_fourcc() and use AV_RL32() instead
Originally committed as revision 16654 to
svn://svn.ffmpeg.org/ffmpeg/trunk
上级
9ce6c138
变更
15
显示空白变更内容
内联
并排
Showing
15 changed file
with
36 addition
and
45 deletion
+36
-45
ffserver.c
ffserver.c
+2
-1
libavcodec/4xm.c
libavcodec/4xm.c
+6
-6
libavcodec/asv1.c
libavcodec/asv1.c
+1
-1
libavcodec/h263.c
libavcodec/h263.c
+4
-4
libavcodec/h263dec.c
libavcodec/h263dec.c
+7
-7
libavcodec/libxvidff.c
libavcodec/libxvidff.c
+1
-1
libavcodec/mjpega_dump_header_bsf.c
libavcodec/mjpega_dump_header_bsf.c
+1
-1
libavcodec/mjpegdec.c
libavcodec/mjpegdec.c
+5
-5
libavcodec/mpeg12.c
libavcodec/mpeg12.c
+1
-1
libavcodec/shorten.c
libavcodec/shorten.c
+1
-1
libavcodec/tta.c
libavcodec/tta.c
+2
-2
libavformat/avidec.c
libavformat/avidec.c
+2
-1
libavformat/tta.c
libavformat/tta.c
+1
-1
libavformat/utils.c
libavformat/utils.c
+2
-2
libavutil/common.h
libavutil/common.h
+0
-11
未找到文件。
ffserver.c
浏览文件 @
2bb6eba2
...
...
@@ -36,6 +36,7 @@
#include "libavformat/rtsp.h"
#include "libavutil/avstring.h"
#include "libavutil/random.h"
#include "libavutil/intreadwrite.h"
#include "libavcodec/opt.h"
#include <stdarg.h>
#include <unistd.h>
...
...
@@ -4187,7 +4188,7 @@ static int parse_ffconfig(const char *filename)
}
else
if
(
!
strcasecmp
(
cmd
,
"VideoTag"
))
{
get_arg
(
arg
,
sizeof
(
arg
),
&
p
);
if
((
strlen
(
arg
)
==
4
)
&&
stream
)
video_enc
.
codec_tag
=
ff_get_fourcc
(
arg
);
video_enc
.
codec_tag
=
AV_RL32
(
arg
);
}
else
if
(
!
strcasecmp
(
cmd
,
"BitExact"
))
{
if
(
stream
)
video_enc
.
flags
|=
CODEC_FLAG_BITEXACT
;
...
...
libavcodec/4xm.c
浏览文件 @
2bb6eba2
...
...
@@ -689,7 +689,7 @@ static int decode_frame(AVCodecContext *avctx,
av_log
(
f
->
avctx
,
AV_LOG_ERROR
,
"size mismatch %d %d
\n
"
,
buf_size
,
AV_RL32
(
buf
+
4
));
}
if
(
frame_4cc
==
ff_get_fourcc
(
"cfrm"
)){
if
(
frame_4cc
==
AV_RL32
(
"cfrm"
)){
int
free_index
=-
1
;
const
int
data_size
=
buf_size
-
20
;
const
int
id
=
AV_RL32
(
buf
+
12
);
...
...
@@ -730,7 +730,7 @@ static int decode_frame(AVCodecContext *avctx,
}
cfrm
->
size
=
cfrm
->
id
=
0
;
frame_4cc
=
ff_get_fourcc
(
"pfrm"
);
frame_4cc
=
AV_RL32
(
"pfrm"
);
}
else
return
buf_size
;
}
else
{
...
...
@@ -756,19 +756,19 @@ static int decode_frame(AVCodecContext *avctx,
return
-
1
;
}
if
(
frame_4cc
==
ff_get_fourcc
(
"ifr2"
)){
if
(
frame_4cc
==
AV_RL32
(
"ifr2"
)){
p
->
pict_type
=
FF_I_TYPE
;
if
(
decode_i2_frame
(
f
,
buf
-
4
,
frame_size
)
<
0
)
return
-
1
;
}
else
if
(
frame_4cc
==
ff_get_fourcc
(
"ifrm"
)){
}
else
if
(
frame_4cc
==
AV_RL32
(
"ifrm"
)){
p
->
pict_type
=
FF_I_TYPE
;
if
(
decode_i_frame
(
f
,
buf
,
frame_size
)
<
0
)
return
-
1
;
}
else
if
(
frame_4cc
==
ff_get_fourcc
(
"pfrm"
)
||
frame_4cc
==
ff_get_fourcc
(
"pfr2"
)){
}
else
if
(
frame_4cc
==
AV_RL32
(
"pfrm"
)
||
frame_4cc
==
AV_RL32
(
"pfr2"
)){
p
->
pict_type
=
FF_P_TYPE
;
if
(
decode_p_frame
(
f
,
buf
,
frame_size
)
<
0
)
return
-
1
;
}
else
if
(
frame_4cc
==
ff_get_fourcc
(
"snd_"
)){
}
else
if
(
frame_4cc
==
AV_RL32
(
"snd_"
)){
av_log
(
avctx
,
AV_LOG_ERROR
,
"ignoring snd_ chunk length:%d
\n
"
,
buf_size
);
}
else
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"ignoring unknown chunk length:%d
\n
"
,
buf_size
);
...
...
libavcodec/asv1.c
浏览文件 @
2bb6eba2
...
...
@@ -584,7 +584,7 @@ static av_cold int encode_init(AVCodecContext *avctx){
avctx
->
extradata
=
av_mallocz
(
8
);
avctx
->
extradata_size
=
8
;
((
uint32_t
*
)
avctx
->
extradata
)[
0
]
=
le2me_32
(
a
->
inv_qscale
);
((
uint32_t
*
)
avctx
->
extradata
)[
1
]
=
le2me_32
(
ff_get_fourcc
(
"ASUS"
));
((
uint32_t
*
)
avctx
->
extradata
)[
1
]
=
le2me_32
(
AV_RL32
(
"ASUS"
));
for
(
i
=
0
;
i
<
64
;
i
++
){
int
q
=
32
*
scale
*
ff_mpeg1_default_intra_matrix
[
i
];
...
...
libavcodec/h263.c
浏览文件 @
2bb6eba2
...
...
@@ -114,7 +114,7 @@ max run: 29/41
static
uint8_t
static_rl_table_store
[
5
][
2
][
2
*
MAX_RUN
+
MAX_LEVEL
+
3
];
#if 0 //3IV1 is quite rare and it slows things down a tiny bit
#define IS_3IV1 s->codec_tag ==
ff_get_fourcc
("3IV1")
#define IS_3IV1 s->codec_tag ==
AV_RL32
("3IV1")
#else
#define IS_3IV1 0
#endif
...
...
@@ -5223,7 +5223,7 @@ int h263_decode_picture_header(MpegEncContext *s)
show_pict_info
(
s
);
}
#if 1
if
(
s
->
pict_type
==
FF_I_TYPE
&&
s
->
codec_tag
==
ff_get_fourcc
(
"ZYGO"
)){
if
(
s
->
pict_type
==
FF_I_TYPE
&&
s
->
codec_tag
==
AV_RL32
(
"ZYGO"
)){
int
i
,
j
;
for
(
i
=
0
;
i
<
85
;
i
++
)
av_log
(
s
->
avctx
,
AV_LOG_DEBUG
,
"%d"
,
get_bits1
(
&
s
->
gb
));
av_log
(
s
->
avctx
,
AV_LOG_DEBUG
,
"
\n
"
);
...
...
@@ -5548,7 +5548,7 @@ static int decode_vol_header(MpegEncContext *s, GetBitContext *gb){
skip_bits1
(
gb
);
/* marker */
height
=
get_bits
(
gb
,
13
);
skip_bits1
(
gb
);
/* marker */
if
(
width
&&
height
&&
!
(
s
->
width
&&
s
->
codec_tag
==
ff_get_fourcc
(
"MP4S"
))){
/* they should be non zero but who knows ... */
if
(
width
&&
height
&&
!
(
s
->
width
&&
s
->
codec_tag
==
AV_RL32
(
"MP4S"
))){
/* they should be non zero but who knows ... */
s
->
width
=
width
;
s
->
height
=
height
;
// printf("width/height: %d %d\n", width, height);
...
...
@@ -6062,7 +6062,7 @@ int ff_mpeg4_decode_picture_header(MpegEncContext * s, GetBitContext *gb)
/* search next start code */
align_get_bits
(
gb
);
if
(
s
->
codec_tag
==
ff_get_fourcc
(
"WV1F"
)
&&
show_bits
(
gb
,
24
)
==
0x575630
){
if
(
s
->
codec_tag
==
AV_RL32
(
"WV1F"
)
&&
show_bits
(
gb
,
24
)
==
0x575630
){
skip_bits
(
gb
,
24
);
if
(
get_bits
(
gb
,
8
)
==
0xF0
)
goto
end
;
...
...
libavcodec/h263dec.c
浏览文件 @
2bb6eba2
...
...
@@ -421,19 +421,19 @@ retry:
avctx
->
has_b_frames
=
!
s
->
low_delay
;
if
(
s
->
xvid_build
==
0
&&
s
->
divx_version
==
0
&&
s
->
lavc_build
==
0
){
if
(
s
->
stream_codec_tag
==
ff_get_fourcc
(
"XVID"
)
||
s
->
codec_tag
==
ff_get_fourcc
(
"XVID"
)
||
s
->
codec_tag
==
ff_get_fourcc
(
"XVIX"
)
||
s
->
codec_tag
==
ff_get_fourcc
(
"RMP4"
))
if
(
s
->
stream_codec_tag
==
AV_RL32
(
"XVID"
)
||
s
->
codec_tag
==
AV_RL32
(
"XVID"
)
||
s
->
codec_tag
==
AV_RL32
(
"XVIX"
)
||
s
->
codec_tag
==
AV_RL32
(
"RMP4"
))
s
->
xvid_build
=
-
1
;
#if 0
if(s->codec_tag ==
ff_get_fourcc
("DIVX") && s->vo_type==0 && s->vol_control_parameters==1
if(s->codec_tag ==
AV_RL32
("DIVX") && s->vo_type==0 && s->vol_control_parameters==1
&& s->padding_bug_score > 0 && s->low_delay) // XVID with modified fourcc
s->xvid_build= -1;
#endif
}
if
(
s
->
xvid_build
==
0
&&
s
->
divx_version
==
0
&&
s
->
lavc_build
==
0
){
if
(
s
->
codec_tag
==
ff_get_fourcc
(
"DIVX"
)
&&
s
->
vo_type
==
0
&&
s
->
vol_control_parameters
==
0
)
if
(
s
->
codec_tag
==
AV_RL32
(
"DIVX"
)
&&
s
->
vo_type
==
0
&&
s
->
vol_control_parameters
==
0
)
s
->
divx_version
=
400
;
//divx 4
}
...
...
@@ -443,10 +443,10 @@ retry:
}
if
(
s
->
workaround_bugs
&
FF_BUG_AUTODETECT
){
if
(
s
->
codec_tag
==
ff_get_fourcc
(
"XVIX"
))
if
(
s
->
codec_tag
==
AV_RL32
(
"XVIX"
))
s
->
workaround_bugs
|=
FF_BUG_XVID_ILACE
;
if
(
s
->
codec_tag
==
ff_get_fourcc
(
"UMP4"
)){
if
(
s
->
codec_tag
==
AV_RL32
(
"UMP4"
)){
s
->
workaround_bugs
|=
FF_BUG_UMP4
;
}
...
...
libavcodec/libxvidff.c
浏览文件 @
2bb6eba2
...
...
@@ -335,7 +335,7 @@ av_cold int ff_xvid_encode_init(AVCodecContext *avctx) {
/* We are claiming to be Xvid */
x
->
quicktime_format
=
0
;
if
(
!
avctx
->
codec_tag
)
avctx
->
codec_tag
=
ff_get_fourcc
(
"xvid"
);
avctx
->
codec_tag
=
AV_RL32
(
"xvid"
);
}
/* Bframes */
...
...
libavcodec/mjpega_dump_header_bsf.c
浏览文件 @
2bb6eba2
...
...
@@ -73,7 +73,7 @@ static int mjpega_dump_header(AVBitStreamFilterContext *bsfc, AVCodecContext *av
*
poutbuf_size
=
poutbufp
-
*
poutbuf
;
return
1
;
case
APP1
:
if
(
i
+
8
<
buf_size
&&
AV_RL32
(
buf
+
i
+
8
)
==
ff_get_fourcc
(
"mjpg"
))
{
if
(
i
+
8
<
buf_size
&&
AV_RL32
(
buf
+
i
+
8
)
==
AV_RL32
(
"mjpg"
))
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"bitstream already formatted
\n
"
);
memcpy
(
*
poutbuf
,
buf
,
buf_size
);
*
poutbuf_size
=
buf_size
;
...
...
libavcodec/mjpegdec.c
浏览文件 @
2bb6eba2
...
...
@@ -1040,7 +1040,7 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
/* buggy AVID, it puts EOI only at every 10th frame */
/* also this fourcc is used by non-avid files too, it holds some
informations, but it's always present in AVID creates files */
if
(
id
==
ff_get_fourcc
(
"AVI1"
))
if
(
id
==
AV_RL32
(
"AVI1"
))
{
/* structure:
4bytes AVI1
...
...
@@ -1068,7 +1068,7 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
// len -= 2;
if
(
id
==
ff_get_fourcc
(
"JFIF"
))
if
(
id
==
AV_RL32
(
"JFIF"
))
{
int
t_w
,
t_h
,
v1
,
v2
;
skip_bits
(
&
s
->
gb
,
8
);
/* the trailing zero-byte */
...
...
@@ -1098,7 +1098,7 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
goto
out
;
}
if
(
id
==
ff_get_fourcc
(
"Adob"
)
&&
(
get_bits
(
&
s
->
gb
,
8
)
==
'e'
))
if
(
id
==
AV_RL32
(
"Adob"
)
&&
(
get_bits
(
&
s
->
gb
,
8
)
==
'e'
))
{
if
(
s
->
avctx
->
debug
&
FF_DEBUG_PICT_INFO
)
av_log
(
s
->
avctx
,
AV_LOG_INFO
,
"mjpeg: Adobe header found
\n
"
);
...
...
@@ -1110,7 +1110,7 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
goto
out
;
}
if
(
id
==
ff_get_fourcc
(
"LJIF"
)){
if
(
id
==
AV_RL32
(
"LJIF"
)){
if
(
s
->
avctx
->
debug
&
FF_DEBUG_PICT_INFO
)
av_log
(
s
->
avctx
,
AV_LOG_INFO
,
"Pegasus lossless jpeg header found
\n
"
);
skip_bits
(
&
s
->
gb
,
16
);
/* version ? */
...
...
@@ -1139,7 +1139,7 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
id
=
(
get_bits
(
&
s
->
gb
,
16
)
<<
16
)
|
get_bits
(
&
s
->
gb
,
16
);
id
=
be2me_32
(
id
);
len
-=
4
;
if
(
id
==
ff_get_fourcc
(
"mjpg"
))
/* Apple MJPEG-A */
if
(
id
==
AV_RL32
(
"mjpg"
))
/* Apple MJPEG-A */
{
#if 0
skip_bits(&s->gb, 32); /* field size */
...
...
libavcodec/mpeg12.c
浏览文件 @
2bb6eba2
...
...
@@ -2278,7 +2278,7 @@ static int mpeg_decode_frame(AVCodecContext *avctx,
}
#endif
if
(
s
->
mpeg_enc_ctx_allocated
==
0
&&
avctx
->
codec_tag
==
ff_get_fourcc
(
"VCR2"
))
if
(
s
->
mpeg_enc_ctx_allocated
==
0
&&
avctx
->
codec_tag
==
AV_RL32
(
"VCR2"
))
vcr2_init_sequence
(
avctx
);
s
->
slice_count
=
0
;
...
...
libavcodec/shorten.c
浏览文件 @
2bb6eba2
...
...
@@ -305,7 +305,7 @@ static int shorten_decode_frame(AVCodecContext *avctx,
{
int
maxnlpc
=
0
;
/* shorten signature */
if
(
get_bits_long
(
&
s
->
gb
,
32
)
!=
bswap_32
(
ff_get_fourcc
(
"ajkg"
)))
{
if
(
get_bits_long
(
&
s
->
gb
,
32
)
!=
bswap_32
(
AV_RL32
(
"ajkg"
)))
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"missing shorten magic 'ajkg'
\n
"
);
return
-
1
;
}
...
...
libavcodec/tta.c
浏览文件 @
2bb6eba2
...
...
@@ -209,11 +209,11 @@ static av_cold int tta_decode_init(AVCodecContext * avctx)
return
-
1
;
init_get_bits
(
&
s
->
gb
,
avctx
->
extradata
,
avctx
->
extradata_size
);
if
(
show_bits_long
(
&
s
->
gb
,
32
)
==
ff_get_fourcc
(
"TTA1"
))
if
(
show_bits_long
(
&
s
->
gb
,
32
)
==
AV_RL32
(
"TTA1"
))
{
/* signature */
skip_bits
(
&
s
->
gb
,
32
);
// if (get_bits_long(&s->gb, 32) != bswap_32(
ff_get_fourcc
("TTA1"))) {
// if (get_bits_long(&s->gb, 32) != bswap_32(
AV_RL32
("TTA1"))) {
// av_log(s->avctx, AV_LOG_ERROR, "Missing magic\n");
// return -1;
// }
...
...
libavformat/avidec.c
浏览文件 @
2bb6eba2
...
...
@@ -19,6 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavutil/intreadwrite.h"
#include "libavutil/bswap.h"
#include "avformat.h"
#include "avi.h"
...
...
@@ -517,7 +518,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
st
->
need_parsing
=
AVSTREAM_PARSE_NONE
;
/* AVI files with Xan DPCM audio (wrongly) declare PCM
* audio in the header but have Axan as stream_code_tag. */
if
(
st
->
codec
->
stream_codec_tag
==
ff_get_fourcc
(
"Axan"
)){
if
(
st
->
codec
->
stream_codec_tag
==
AV_RL32
(
"Axan"
)){
st
->
codec
->
codec_id
=
CODEC_ID_XAN_DPCM
;
st
->
codec
->
codec_tag
=
0
;
}
...
...
libavformat/tta.c
浏览文件 @
2bb6eba2
...
...
@@ -41,7 +41,7 @@ static int tta_read_header(AVFormatContext *s, AVFormatParameters *ap)
int
i
,
channels
,
bps
,
samplerate
,
datalen
,
framelen
;
uint64_t
framepos
;
if
(
get_le32
(
s
->
pb
)
!=
ff_get_fourcc
(
"TTA1"
))
if
(
get_le32
(
s
->
pb
)
!=
AV_RL32
(
"TTA1"
))
return
-
1
;
// not tta file
url_fskip
(
s
->
pb
,
2
);
// FIXME: flags
...
...
libavformat/utils.c
浏览文件 @
2bb6eba2
...
...
@@ -1946,8 +1946,8 @@ static int get_std_framerate(int i){
static
int
tb_unreliable
(
AVCodecContext
*
c
){
if
(
c
->
time_base
.
den
>=
101L
*
c
->
time_base
.
num
||
c
->
time_base
.
den
<
5L
*
c
->
time_base
.
num
/* || c->codec_tag ==
ff_get_fourcc
("DIVX")
|| c->codec_tag ==
ff_get_fourcc
("XVID")*/
/* || c->codec_tag ==
AV_RL32
("DIVX")
|| c->codec_tag ==
AV_RL32
("XVID")*/
||
c
->
codec_id
==
CODEC_ID_MPEG2VIDEO
)
return
1
;
return
0
;
...
...
libavutil/common.h
浏览文件 @
2bb6eba2
...
...
@@ -242,17 +242,6 @@ static inline av_const float av_clipf(float a, float amin, float amax)
else
return
a
;
}
/**
* converts fourcc string to int
*/
static
inline
av_pure
int
ff_get_fourcc
(
const
char
*
s
){
#ifdef HAVE_AV_CONFIG_H
assert
(
strlen
(
s
)
==
4
);
#endif
return
(
s
[
0
])
+
(
s
[
1
]
<<
8
)
+
(
s
[
2
]
<<
16
)
+
(
s
[
3
]
<<
24
);
}
#define MKTAG(a,b,c,d) (a | (b << 8) | (c << 16) | (d << 24))
#define MKBETAG(a,b,c,d) (d | (c << 8) | (b << 16) | (a << 24))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录