Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
8fc0162a
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,发现更多精彩内容 >>
提交
8fc0162a
编写于
7月 10, 2010
作者:
M
Måns Rullgård
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add av_ prefix to bswap macros
Originally committed as revision 24170 to
svn://svn.ffmpeg.org/ffmpeg/trunk
上级
e6b22522
变更
51
显示空白变更内容
内联
并排
Showing
51 changed file
with
175 addition
and
175 deletion
+175
-175
libavcodec/4xm.c
libavcodec/4xm.c
+6
-6
libavcodec/8bps.c
libavcodec/8bps.c
+1
-1
libavcodec/aac_parser.c
libavcodec/aac_parser.c
+1
-1
libavcodec/ac3_parser.c
libavcodec/ac3_parser.c
+1
-1
libavcodec/ac3enc.c
libavcodec/ac3enc.c
+2
-2
libavcodec/alsdec.c
libavcodec/alsdec.c
+2
-2
libavcodec/asv1.c
libavcodec/asv1.c
+2
-2
libavcodec/atrac3.c
libavcodec/atrac3.c
+1
-1
libavcodec/bmp.c
libavcodec/bmp.c
+1
-1
libavcodec/cook.c
libavcodec/cook.c
+2
-2
libavcodec/dca.c
libavcodec/dca.c
+1
-1
libavcodec/dsputil.c
libavcodec/dsputil.c
+9
-9
libavcodec/eamad.c
libavcodec/eamad.c
+1
-1
libavcodec/flacenc.c
libavcodec/flacenc.c
+2
-2
libavcodec/get_bits.h
libavcodec/get_bits.h
+2
-2
libavcodec/imc.c
libavcodec/imc.c
+1
-1
libavcodec/indeo3.c
libavcodec/indeo3.c
+33
-33
libavcodec/mjpegdec.c
libavcodec/mjpegdec.c
+2
-2
libavcodec/pngdec.c
libavcodec/pngdec.c
+1
-1
libavcodec/pngenc.c
libavcodec/pngenc.c
+1
-1
libavcodec/pnmdec.c
libavcodec/pnmdec.c
+1
-1
libavcodec/put_bits.h
libavcodec/put_bits.h
+5
-5
libavcodec/r210dec.c
libavcodec/r210dec.c
+1
-1
libavcodec/shorten.c
libavcodec/shorten.c
+2
-2
libavcodec/smacker.c
libavcodec/smacker.c
+1
-1
libavcodec/tta.c
libavcodec/tta.c
+1
-1
libavcodec/v210dec.c
libavcodec/v210dec.c
+3
-3
libavcodec/v210x.c
libavcodec/v210x.c
+4
-4
libavformat/asfcrypt.c
libavformat/asfcrypt.c
+1
-1
libavformat/asfdec.c
libavformat/asfdec.c
+1
-1
libavformat/avidec.c
libavformat/avidec.c
+1
-1
libavformat/electronicarts.c
libavformat/electronicarts.c
+1
-1
libavformat/mov.c
libavformat/mov.c
+1
-1
libavformat/mpegtsenc.c
libavformat/mpegtsenc.c
+1
-1
libavformat/mtv.c
libavformat/mtv.c
+1
-1
libavformat/nutdec.c
libavformat/nutdec.c
+1
-1
libavformat/smacker.c
libavformat/smacker.c
+4
-4
libavformat/sol.c
libavformat/sol.c
+1
-1
libavformat/spdif.c
libavformat/spdif.c
+9
-9
libavutil/arm/bswap.h
libavutil/arm/bswap.h
+8
-8
libavutil/avr32/bswap.h
libavutil/avr32/bswap.h
+4
-4
libavutil/avr32/intreadwrite.h
libavutil/avr32/intreadwrite.h
+2
-2
libavutil/bfin/bswap.h
libavutil/bfin/bswap.h
+2
-2
libavutil/bswap.h
libavutil/bswap.h
+20
-20
libavutil/crc.c
libavutil/crc.c
+3
-3
libavutil/des.c
libavutil/des.c
+4
-4
libavutil/intreadwrite.h
libavutil/intreadwrite.h
+4
-4
libavutil/md5.c
libavutil/md5.c
+3
-3
libavutil/sh4/bswap.h
libavutil/sh4/bswap.h
+4
-4
libavutil/sha.c
libavutil/sha.c
+3
-3
libavutil/x86/bswap.h
libavutil/x86/bswap.h
+6
-6
未找到文件。
libavcodec/4xm.c
浏览文件 @
8fc0162a
...
...
@@ -333,16 +333,16 @@ static void decode_p_block(FourXContext *f, uint16_t *dst, uint16_t *src, int lo
av_log
(
f
->
avctx
,
AV_LOG_ERROR
,
"mv out of pic
\n
"
);
return
;
}
mcdc
(
dst
,
src
,
log2w
,
h
,
stride
,
1
,
le2ne_
16
(
*
f
->
wordstream
++
));
mcdc
(
dst
,
src
,
log2w
,
h
,
stride
,
1
,
av_le2ne
16
(
*
f
->
wordstream
++
));
}
else
if
(
code
==
5
){
mcdc
(
dst
,
src
,
log2w
,
h
,
stride
,
0
,
le2ne_
16
(
*
f
->
wordstream
++
));
mcdc
(
dst
,
src
,
log2w
,
h
,
stride
,
0
,
av_le2ne
16
(
*
f
->
wordstream
++
));
}
else
if
(
code
==
6
){
if
(
log2w
){
dst
[
0
]
=
le2ne_
16
(
*
f
->
wordstream
++
);
dst
[
1
]
=
le2ne_
16
(
*
f
->
wordstream
++
);
dst
[
0
]
=
av_le2ne
16
(
*
f
->
wordstream
++
);
dst
[
1
]
=
av_le2ne
16
(
*
f
->
wordstream
++
);
}
else
{
dst
[
0
]
=
le2ne_
16
(
*
f
->
wordstream
++
);
dst
[
stride
]
=
le2ne_
16
(
*
f
->
wordstream
++
);
dst
[
0
]
=
av_le2ne
16
(
*
f
->
wordstream
++
);
dst
[
stride
]
=
av_le2ne
16
(
*
f
->
wordstream
++
);
}
}
}
...
...
libavcodec/8bps.c
浏览文件 @
8fc0162a
...
...
@@ -100,7 +100,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
for
(
row
=
0
;
row
<
height
;
row
++
)
{
pixptr
=
c
->
pic
.
data
[
0
]
+
row
*
c
->
pic
.
linesize
[
0
]
+
planemap
[
p
];
pixptr_end
=
pixptr
+
c
->
pic
.
linesize
[
0
];
dlen
=
be2ne_
16
(
*
(
const
unsigned
short
*
)(
lp
+
row
*
2
));
dlen
=
av_be2ne
16
(
*
(
const
unsigned
short
*
)(
lp
+
row
*
2
));
/* Decode a row of this plane */
while
(
dlen
>
0
)
{
if
(
dp
+
1
>=
buf
+
buf_size
)
return
-
1
;
...
...
libavcodec/aac_parser.c
浏览文件 @
8fc0162a
...
...
@@ -80,7 +80,7 @@ static int aac_sync(uint64_t state, AACAC3ParseContext *hdr_info,
uint8_t
u8
[
8
];
}
tmp
;
tmp
.
u64
=
be2ne_
64
(
state
);
tmp
.
u64
=
av_be2ne
64
(
state
);
init_get_bits
(
&
bits
,
tmp
.
u8
+
8
-
AAC_ADTS_HEADER_SIZE
,
AAC_ADTS_HEADER_SIZE
*
8
);
if
((
size
=
ff_aac_parse_header
(
&
bits
,
&
hdr
))
<
0
)
...
...
libavcodec/ac3_parser.c
浏览文件 @
8fc0162a
...
...
@@ -164,7 +164,7 @@ static int ac3_sync(uint64_t state, AACAC3ParseContext *hdr_info,
union
{
uint64_t
u64
;
uint8_t
u8
[
8
];
}
tmp
=
{
be2ne_
64
(
state
)
};
}
tmp
=
{
av_be2ne
64
(
state
)
};
AC3HeaderInfo
hdr
;
GetBitContext
gbc
;
...
...
libavcodec/ac3enc.c
浏览文件 @
8fc0162a
...
...
@@ -1161,14 +1161,14 @@ static int output_frame_end(AC3EncodeContext *s)
/* Now we must compute both crcs : this is not so easy for crc1
because it is at the beginning of the data... */
frame_size_58
=
(
frame_size
>>
1
)
+
(
frame_size
>>
3
);
crc1
=
bswap_
16
(
av_crc
(
av_crc_get_table
(
AV_CRC_16_ANSI
),
0
,
crc1
=
av_bswap
16
(
av_crc
(
av_crc_get_table
(
AV_CRC_16_ANSI
),
0
,
frame
+
4
,
2
*
frame_size_58
-
4
));
/* XXX: could precompute crc_inv */
crc_inv
=
pow_poly
((
CRC16_POLY
>>
1
),
(
16
*
frame_size_58
)
-
16
,
CRC16_POLY
);
crc1
=
mul_poly
(
crc_inv
,
crc1
,
CRC16_POLY
);
AV_WB16
(
frame
+
2
,
crc1
);
crc2
=
bswap_
16
(
av_crc
(
av_crc_get_table
(
AV_CRC_16_ANSI
),
0
,
crc2
=
av_bswap
16
(
av_crc
(
av_crc_get_table
(
AV_CRC_16_ANSI
),
0
,
frame
+
2
*
frame_size_58
,
(
frame_size
-
frame_size_58
)
*
2
-
2
));
AV_WB16
(
frame
+
2
*
frame_size
-
2
,
crc2
);
...
...
libavcodec/alsdec.c
浏览文件 @
8fc0162a
...
...
@@ -1464,7 +1464,7 @@ static int decode_frame(AVCodecContext *avctx,
int32_t
v
;
if
(
swap
)
v
=
bswap_
32
(
src
[
sample
]);
v
=
av_bswap
32
(
src
[
sample
]);
else
v
=
src
[
sample
];
if
(
!
HAVE_BIGENDIAN
)
...
...
@@ -1482,7 +1482,7 @@ static int decode_frame(AVCodecContext *avctx,
for
(
sample
=
0
;
sample
<
ctx
->
cur_frame_length
*
avctx
->
channels
;
sample
++
)
*
dest
++
=
bswap_
16
(
src
[
sample
]);
*
dest
++
=
av_bswap
16
(
src
[
sample
]);
}
else
{
ctx
->
dsp
.
bswap_buf
((
uint32_t
*
)
ctx
->
crc_buffer
,
data
,
ctx
->
cur_frame_length
*
avctx
->
channels
);
...
...
libavcodec/asv1.c
浏览文件 @
8fc0162a
...
...
@@ -588,8 +588,8 @@ static av_cold int encode_init(AVCodecContext *avctx){
avctx
->
extradata
=
av_mallocz
(
8
);
avctx
->
extradata_size
=
8
;
((
uint32_t
*
)
avctx
->
extradata
)[
0
]
=
le2ne_
32
(
a
->
inv_qscale
);
((
uint32_t
*
)
avctx
->
extradata
)[
1
]
=
le2ne_
32
(
AV_RL32
(
"ASUS"
));
((
uint32_t
*
)
avctx
->
extradata
)[
0
]
=
av_le2ne
32
(
a
->
inv_qscale
);
((
uint32_t
*
)
avctx
->
extradata
)[
1
]
=
av_le2ne
32
(
AV_RL32
(
"ASUS"
));
for
(
i
=
0
;
i
<
64
;
i
++
){
int
q
=
32
*
scale
*
ff_mpeg1_default_intra_matrix
[
i
];
...
...
libavcodec/atrac3.c
浏览文件 @
8fc0162a
...
...
@@ -179,7 +179,7 @@ static int decode_bytes(const uint8_t* inbuffer, uint8_t* out, int bytes){
off
=
(
intptr_t
)
inbuffer
&
3
;
buf
=
(
const
uint32_t
*
)
(
inbuffer
-
off
);
c
=
be2ne_
32
((
0x537F6103
>>
(
off
*
8
))
|
(
0x537F6103
<<
(
32
-
(
off
*
8
))));
c
=
av_be2ne
32
((
0x537F6103
>>
(
off
*
8
))
|
(
0x537F6103
<<
(
32
-
(
off
*
8
))));
bytes
+=
3
+
off
;
for
(
i
=
0
;
i
<
bytes
/
4
;
i
++
)
obuf
[
i
]
=
c
^
buf
[
i
];
...
...
libavcodec/bmp.c
浏览文件 @
8fc0162a
...
...
@@ -290,7 +290,7 @@ static int bmp_decode_frame(AVCodecContext *avctx,
uint16_t
*
dst
=
(
uint16_t
*
)
ptr
;
for
(
j
=
0
;
j
<
avctx
->
width
;
j
++
)
*
dst
++
=
le2ne_
16
(
*
src
++
);
*
dst
++
=
av_le2ne
16
(
*
src
++
);
buf
+=
n
;
ptr
+=
linesize
;
...
...
libavcodec/cook.c
浏览文件 @
8fc0162a
...
...
@@ -316,12 +316,12 @@ static inline int decode_bytes(const uint8_t* inbuffer, uint8_t* out, int bytes)
/* FIXME: 64 bit platforms would be able to do 64 bits at a time.
* I'm too lazy though, should be something like
* for(i=0 ; i<bitamount/64 ; i++)
* (int64_t)out[i] = 0x37c511f237c511f2^
be2ne_
64(int64_t)in[i]);
* (int64_t)out[i] = 0x37c511f237c511f2^
av_be2ne
64(int64_t)in[i]);
* Buffer alignment needs to be checked. */
off
=
(
intptr_t
)
inbuffer
&
3
;
buf
=
(
const
uint32_t
*
)
(
inbuffer
-
off
);
c
=
be2ne_
32
((
0x37c511f2
>>
(
off
*
8
))
|
(
0x37c511f2
<<
(
32
-
(
off
*
8
))));
c
=
av_be2ne
32
((
0x37c511f2
>>
(
off
*
8
))
|
(
0x37c511f2
<<
(
32
-
(
off
*
8
))));
bytes
+=
3
+
off
;
for
(
i
=
0
;
i
<
bytes
/
4
;
i
++
)
obuf
[
i
]
=
c
^
buf
[
i
];
...
...
libavcodec/dca.c
浏览文件 @
8fc0162a
...
...
@@ -1230,7 +1230,7 @@ static int dca_convert_bitstream(const uint8_t * src, int src_size, uint8_t * ds
return
src_size
;
case
DCA_MARKER_RAW_LE
:
for
(
i
=
0
;
i
<
(
src_size
+
1
)
>>
1
;
i
++
)
*
sdst
++
=
bswap_
16
(
*
ssrc
++
);
*
sdst
++
=
av_bswap
16
(
*
ssrc
++
);
return
src_size
;
case
DCA_MARKER_14B_BE
:
case
DCA_MARKER_14B_LE
:
...
...
libavcodec/dsputil.c
浏览文件 @
8fc0162a
...
...
@@ -247,17 +247,17 @@ static void bswap_buf(uint32_t *dst, const uint32_t *src, int w){
int
i
;
for
(
i
=
0
;
i
+
8
<=
w
;
i
+=
8
){
dst
[
i
+
0
]
=
bswap_
32
(
src
[
i
+
0
]);
dst
[
i
+
1
]
=
bswap_
32
(
src
[
i
+
1
]);
dst
[
i
+
2
]
=
bswap_
32
(
src
[
i
+
2
]);
dst
[
i
+
3
]
=
bswap_
32
(
src
[
i
+
3
]);
dst
[
i
+
4
]
=
bswap_
32
(
src
[
i
+
4
]);
dst
[
i
+
5
]
=
bswap_
32
(
src
[
i
+
5
]);
dst
[
i
+
6
]
=
bswap_
32
(
src
[
i
+
6
]);
dst
[
i
+
7
]
=
bswap_
32
(
src
[
i
+
7
]);
dst
[
i
+
0
]
=
av_bswap
32
(
src
[
i
+
0
]);
dst
[
i
+
1
]
=
av_bswap
32
(
src
[
i
+
1
]);
dst
[
i
+
2
]
=
av_bswap
32
(
src
[
i
+
2
]);
dst
[
i
+
3
]
=
av_bswap
32
(
src
[
i
+
3
]);
dst
[
i
+
4
]
=
av_bswap
32
(
src
[
i
+
4
]);
dst
[
i
+
5
]
=
av_bswap
32
(
src
[
i
+
5
]);
dst
[
i
+
6
]
=
av_bswap
32
(
src
[
i
+
6
]);
dst
[
i
+
7
]
=
av_bswap
32
(
src
[
i
+
7
]);
}
for
(;
i
<
w
;
i
++
){
dst
[
i
+
0
]
=
bswap_
32
(
src
[
i
+
0
]);
dst
[
i
+
0
]
=
av_bswap
32
(
src
[
i
+
0
]);
}
}
...
...
libavcodec/eamad.c
浏览文件 @
8fc0162a
...
...
@@ -53,7 +53,7 @@ static void bswap16_buf(uint16_t *dst, const uint16_t *src, int count)
{
int
i
;
for
(
i
=
0
;
i
<
count
;
i
++
)
dst
[
i
]
=
bswap_
16
(
src
[
i
]);
dst
[
i
]
=
av_bswap
16
(
src
[
i
]);
}
static
av_cold
int
decode_init
(
AVCodecContext
*
avctx
)
...
...
libavcodec/flacenc.c
浏览文件 @
8fc0162a
...
...
@@ -1153,7 +1153,7 @@ static void output_frame_footer(FlacEncodeContext *s)
{
int
crc
;
flush_put_bits
(
&
s
->
pb
);
crc
=
bswap_
16
(
av_crc
(
av_crc_get_table
(
AV_CRC_16_ANSI
),
0
,
crc
=
av_bswap
16
(
av_crc
(
av_crc_get_table
(
AV_CRC_16_ANSI
),
0
,
s
->
pb
.
buf
,
put_bits_count
(
&
s
->
pb
)
>>
3
));
put_bits
(
&
s
->
pb
,
16
,
crc
);
flush_put_bits
(
&
s
->
pb
);
...
...
@@ -1164,7 +1164,7 @@ static void update_md5_sum(FlacEncodeContext *s, int16_t *samples)
#if HAVE_BIGENDIAN
int
i
;
for
(
i
=
0
;
i
<
s
->
frame
.
blocksize
*
s
->
channels
;
i
++
)
{
int16_t
smp
=
le2ne_
16
(
samples
[
i
]);
int16_t
smp
=
av_le2ne
16
(
samples
[
i
]);
av_md5_update
(
s
->
md5ctx
,
(
uint8_t
*
)
&
smp
,
2
);
}
#else
...
...
libavcodec/get_bits.h
浏览文件 @
8fc0162a
...
...
@@ -267,7 +267,7 @@ static inline void skip_bits_long(GetBitContext *s, int n){
# define UPDATE_CACHE(name, gb)\
if(name##_bit_count > 0){\
const uint32_t next=
be2ne_
32( *name##_buffer_ptr );\
const uint32_t next=
av_be2ne
32( *name##_buffer_ptr );\
name##_cache0 |= NEG_USR32(next,name##_bit_count);\
name##_cache1 |= next<<name##_bit_count;\
name##_buffer_ptr++;\
...
...
@@ -319,7 +319,7 @@ static inline void skip_bits_long(GetBitContext *s, int n){
re_bit_count
+=
n
;
re_buffer_ptr
+=
re_bit_count
>>
5
;
re_bit_count
&=
31
;
re_cache0
=
be2ne_
32
(
re_buffer_ptr
[
-
1
]
)
<<
re_bit_count
;
re_cache0
=
av_be2ne
32
(
re_buffer_ptr
[
-
1
]
)
<<
re_bit_count
;
re_cache1
=
0
;
UPDATE_CACHE
(
re
,
s
)
CLOSE_READER
(
re
,
s
)
...
...
libavcodec/imc.c
浏览文件 @
8fc0162a
...
...
@@ -660,7 +660,7 @@ static int imc_decode_frame(AVCodecContext * avctx,
return
-
1
;
}
for
(
i
=
0
;
i
<
IMC_BLOCK_SIZE
/
2
;
i
++
)
buf16
[
i
]
=
bswap_
16
(((
const
uint16_t
*
)
buf
)[
i
]);
buf16
[
i
]
=
av_bswap
16
(((
const
uint16_t
*
)
buf
)[
i
]);
init_get_bits
(
&
q
->
gb
,
(
const
uint8_t
*
)
buf16
,
IMC_BLOCK_SIZE
*
8
);
...
...
libavcodec/indeo3.c
浏览文件 @
8fc0162a
...
...
@@ -359,14 +359,14 @@ static void iv_Decode_Chunk(Indeo3DecodeContext *s,
switch
(
correction_type_sp
[
0
][
k
])
{
case
0
:
*
cur_lp
=
le2ne_32
(((
le2ne_
32
(
*
ref_lp
)
>>
1
)
+
correction_lp
[
lp2
&
0x01
][
k
])
<<
1
);
*
cur_lp
=
av_le2ne32
(((
av_le2ne
32
(
*
ref_lp
)
>>
1
)
+
correction_lp
[
lp2
&
0x01
][
k
])
<<
1
);
lp2
++
;
break
;
case
1
:
res
=
((
le2ne_
16
(((
unsigned
short
*
)(
ref_lp
))[
0
])
>>
1
)
+
correction_lp
[
lp2
&
0x01
][
*
buf1
])
<<
1
;
((
unsigned
short
*
)
cur_lp
)[
0
]
=
le2ne_
16
(
res
);
res
=
((
le2ne_
16
(((
unsigned
short
*
)(
ref_lp
))[
1
])
>>
1
)
+
correction_lp
[
lp2
&
0x01
][
k
])
<<
1
;
((
unsigned
short
*
)
cur_lp
)[
1
]
=
le2ne_
16
(
res
);
res
=
((
av_le2ne
16
(((
unsigned
short
*
)(
ref_lp
))[
0
])
>>
1
)
+
correction_lp
[
lp2
&
0x01
][
*
buf1
])
<<
1
;
((
unsigned
short
*
)
cur_lp
)[
0
]
=
av_le2ne
16
(
res
);
res
=
((
av_le2ne
16
(((
unsigned
short
*
)(
ref_lp
))[
1
])
>>
1
)
+
correction_lp
[
lp2
&
0x01
][
k
])
<<
1
;
((
unsigned
short
*
)
cur_lp
)[
1
]
=
av_le2ne
16
(
res
);
buf1
++
;
lp2
++
;
break
;
...
...
@@ -462,19 +462,19 @@ static void iv_Decode_Chunk(Indeo3DecodeContext *s,
switch
(
correction_type_sp
[
lp2
&
0x01
][
k
])
{
case
0
:
cur_lp
[
width_tbl
[
1
]]
=
le2ne_32
(((
le2ne_
32
(
*
ref_lp
)
>>
1
)
+
correction_lp
[
lp2
&
0x01
][
k
])
<<
1
);
cur_lp
[
width_tbl
[
1
]]
=
av_le2ne32
(((
av_le2ne
32
(
*
ref_lp
)
>>
1
)
+
correction_lp
[
lp2
&
0x01
][
k
])
<<
1
);
if
(
lp2
>
0
||
flag1
==
0
||
strip
->
ypos
!=
0
)
cur_lp
[
0
]
=
((
cur_lp
[
-
width_tbl
[
1
]]
>>
1
)
+
(
cur_lp
[
width_tbl
[
1
]]
>>
1
))
&
0xFEFEFEFE
;
else
cur_lp
[
0
]
=
le2ne_32
(((
le2ne_
32
(
*
ref_lp
)
>>
1
)
+
correction_lp
[
lp2
&
0x01
][
k
])
<<
1
);
cur_lp
[
0
]
=
av_le2ne32
(((
av_le2ne
32
(
*
ref_lp
)
>>
1
)
+
correction_lp
[
lp2
&
0x01
][
k
])
<<
1
);
lp2
++
;
break
;
case
1
:
res
=
((
le2ne_
16
(((
unsigned
short
*
)
ref_lp
)[
0
])
>>
1
)
+
correction_lp
[
lp2
&
0x01
][
*
buf1
])
<<
1
;
((
unsigned
short
*
)
cur_lp
)[
width_tbl
[
2
]]
=
le2ne_
16
(
res
);
res
=
((
le2ne_
16
(((
unsigned
short
*
)
ref_lp
)[
1
])
>>
1
)
+
correction_lp
[
lp2
&
0x01
][
k
])
<<
1
;
((
unsigned
short
*
)
cur_lp
)[
width_tbl
[
2
]
+
1
]
=
le2ne_
16
(
res
);
res
=
((
av_le2ne
16
(((
unsigned
short
*
)
ref_lp
)[
0
])
>>
1
)
+
correction_lp
[
lp2
&
0x01
][
*
buf1
])
<<
1
;
((
unsigned
short
*
)
cur_lp
)[
width_tbl
[
2
]]
=
av_le2ne
16
(
res
);
res
=
((
av_le2ne
16
(((
unsigned
short
*
)
ref_lp
)[
1
])
>>
1
)
+
correction_lp
[
lp2
&
0x01
][
k
])
<<
1
;
((
unsigned
short
*
)
cur_lp
)[
width_tbl
[
2
]
+
1
]
=
av_le2ne
16
(
res
);
if
(
lp2
>
0
||
flag1
==
0
||
strip
->
ypos
!=
0
)
cur_lp
[
0
]
=
((
cur_lp
[
-
width_tbl
[
1
]]
>>
1
)
+
(
cur_lp
[
width_tbl
[
1
]]
>>
1
))
&
0xFEFEFEFE
;
...
...
@@ -591,8 +591,8 @@ static void iv_Decode_Chunk(Indeo3DecodeContext *s,
switch
(
correction_type_sp
[
lp2
&
0x01
][
k
])
{
case
0
:
cur_lp
[
width_tbl
[
1
]]
=
le2ne_32
(((
le2ne_
32
(
lv1
)
>>
1
)
+
correctionloworder_lp
[
lp2
&
0x01
][
k
])
<<
1
);
cur_lp
[
width_tbl
[
1
]
+
1
]
=
le2ne_32
(((
le2ne_
32
(
lv2
)
>>
1
)
+
correctionhighorder_lp
[
lp2
&
0x01
][
k
])
<<
1
);
cur_lp
[
width_tbl
[
1
]]
=
av_le2ne32
(((
av_le2ne
32
(
lv1
)
>>
1
)
+
correctionloworder_lp
[
lp2
&
0x01
][
k
])
<<
1
);
cur_lp
[
width_tbl
[
1
]
+
1
]
=
av_le2ne32
(((
av_le2ne
32
(
lv2
)
>>
1
)
+
correctionhighorder_lp
[
lp2
&
0x01
][
k
])
<<
1
);
if
(
lp2
>
0
||
strip
->
ypos
!=
0
||
flag1
==
0
)
{
cur_lp
[
0
]
=
((
cur_lp
[
-
width_tbl
[
1
]]
>>
1
)
+
(
cur_lp
[
width_tbl
[
1
]]
>>
1
))
&
0xFEFEFEFE
;
cur_lp
[
1
]
=
((
cur_lp
[
-
width_tbl
[
1
]
+
1
]
>>
1
)
+
(
cur_lp
[
width_tbl
[
1
]
+
1
]
>>
1
))
&
0xFEFEFEFE
;
...
...
@@ -604,8 +604,8 @@ static void iv_Decode_Chunk(Indeo3DecodeContext *s,
break
;
case
1
:
cur_lp
[
width_tbl
[
1
]]
=
le2ne_32
(((
le2ne_
32
(
lv1
)
>>
1
)
+
correctionloworder_lp
[
lp2
&
0x01
][
*
buf1
])
<<
1
);
cur_lp
[
width_tbl
[
1
]
+
1
]
=
le2ne_32
(((
le2ne_
32
(
lv2
)
>>
1
)
+
correctionloworder_lp
[
lp2
&
0x01
][
k
])
<<
1
);
cur_lp
[
width_tbl
[
1
]]
=
av_le2ne32
(((
av_le2ne
32
(
lv1
)
>>
1
)
+
correctionloworder_lp
[
lp2
&
0x01
][
*
buf1
])
<<
1
);
cur_lp
[
width_tbl
[
1
]
+
1
]
=
av_le2ne32
(((
av_le2ne
32
(
lv2
)
>>
1
)
+
correctionloworder_lp
[
lp2
&
0x01
][
k
])
<<
1
);
if
(
lp2
>
0
||
strip
->
ypos
!=
0
||
flag1
==
0
)
{
cur_lp
[
0
]
=
((
cur_lp
[
-
width_tbl
[
1
]]
>>
1
)
+
(
cur_lp
[
width_tbl
[
1
]]
>>
1
))
&
0xFEFEFEFE
;
cur_lp
[
1
]
=
((
cur_lp
[
-
width_tbl
[
1
]
+
1
]
>>
1
)
+
(
cur_lp
[
width_tbl
[
1
]
+
1
]
>>
1
))
&
0xFEFEFEFE
;
...
...
@@ -748,20 +748,20 @@ static void iv_Decode_Chunk(Indeo3DecodeContext *s,
case
0
:
lv1
=
correctionloworder_lp
[
lp2
&
0x01
][
k
];
lv2
=
correctionhighorder_lp
[
lp2
&
0x01
][
k
];
cur_lp
[
0
]
=
le2ne_32
(((
le2ne_
32
(
ref_lp
[
0
])
>>
1
)
+
lv1
)
<<
1
);
cur_lp
[
1
]
=
le2ne_32
(((
le2ne_
32
(
ref_lp
[
1
])
>>
1
)
+
lv2
)
<<
1
);
cur_lp
[
width_tbl
[
1
]]
=
le2ne_32
(((
le2ne_
32
(
ref_lp
[
width_tbl
[
1
]])
>>
1
)
+
lv1
)
<<
1
);
cur_lp
[
width_tbl
[
1
]
+
1
]
=
le2ne_32
(((
le2ne_
32
(
ref_lp
[
width_tbl
[
1
]
+
1
])
>>
1
)
+
lv2
)
<<
1
);
cur_lp
[
0
]
=
av_le2ne32
(((
av_le2ne
32
(
ref_lp
[
0
])
>>
1
)
+
lv1
)
<<
1
);
cur_lp
[
1
]
=
av_le2ne32
(((
av_le2ne
32
(
ref_lp
[
1
])
>>
1
)
+
lv2
)
<<
1
);
cur_lp
[
width_tbl
[
1
]]
=
av_le2ne32
(((
av_le2ne
32
(
ref_lp
[
width_tbl
[
1
]])
>>
1
)
+
lv1
)
<<
1
);
cur_lp
[
width_tbl
[
1
]
+
1
]
=
av_le2ne32
(((
av_le2ne
32
(
ref_lp
[
width_tbl
[
1
]
+
1
])
>>
1
)
+
lv2
)
<<
1
);
lp2
++
;
break
;
case
1
:
lv1
=
correctionloworder_lp
[
lp2
&
0x01
][
*
buf1
++
];
lv2
=
correctionloworder_lp
[
lp2
&
0x01
][
k
];
cur_lp
[
0
]
=
le2ne_32
(((
le2ne_
32
(
ref_lp
[
0
])
>>
1
)
+
lv1
)
<<
1
);
cur_lp
[
1
]
=
le2ne_32
(((
le2ne_
32
(
ref_lp
[
1
])
>>
1
)
+
lv2
)
<<
1
);
cur_lp
[
width_tbl
[
1
]]
=
le2ne_32
(((
le2ne_
32
(
ref_lp
[
width_tbl
[
1
]])
>>
1
)
+
lv1
)
<<
1
);
cur_lp
[
width_tbl
[
1
]
+
1
]
=
le2ne_32
(((
le2ne_
32
(
ref_lp
[
width_tbl
[
1
]
+
1
])
>>
1
)
+
lv2
)
<<
1
);
cur_lp
[
0
]
=
av_le2ne32
(((
av_le2ne
32
(
ref_lp
[
0
])
>>
1
)
+
lv1
)
<<
1
);
cur_lp
[
1
]
=
av_le2ne32
(((
av_le2ne
32
(
ref_lp
[
1
])
>>
1
)
+
lv2
)
<<
1
);
cur_lp
[
width_tbl
[
1
]]
=
av_le2ne32
(((
av_le2ne
32
(
ref_lp
[
width_tbl
[
1
]])
>>
1
)
+
lv1
)
<<
1
);
cur_lp
[
width_tbl
[
1
]
+
1
]
=
av_le2ne32
(((
av_le2ne
32
(
ref_lp
[
width_tbl
[
1
]
+
1
])
>>
1
)
+
lv2
)
<<
1
);
lp2
++
;
break
;
...
...
@@ -849,22 +849,22 @@ static void iv_Decode_Chunk(Indeo3DecodeContext *s,
switch
(
correction_type_sp
[
lp2
&
0x01
][
k
])
{
case
0
:
cur_lp
[
0
]
=
le2ne_32
(((
le2ne_
32
(
*
ref_lp
)
>>
1
)
+
correction_lp
[
lp2
&
0x01
][
k
])
<<
1
);
cur_lp
[
width_tbl
[
1
]]
=
le2ne_32
(((
le2ne_
32
(
ref_lp
[
width_tbl
[
1
]])
>>
1
)
+
correction_lp
[
lp2
&
0x01
][
k
])
<<
1
);
cur_lp
[
0
]
=
av_le2ne32
(((
av_le2ne
32
(
*
ref_lp
)
>>
1
)
+
correction_lp
[
lp2
&
0x01
][
k
])
<<
1
);
cur_lp
[
width_tbl
[
1
]]
=
av_le2ne32
(((
av_le2ne
32
(
ref_lp
[
width_tbl
[
1
]])
>>
1
)
+
correction_lp
[
lp2
&
0x01
][
k
])
<<
1
);
lp2
++
;
break
;
case
1
:
lv1
=
(
unsigned
short
)(
correction_lp
[
lp2
&
0x01
][
*
buf1
++
]);
lv2
=
(
unsigned
short
)(
correction_lp
[
lp2
&
0x01
][
k
]);
res
=
(
unsigned
short
)(((
le2ne_
16
(((
unsigned
short
*
)
ref_lp
)[
0
])
>>
1
)
+
lv1
)
<<
1
);
((
unsigned
short
*
)
cur_lp
)[
0
]
=
le2ne_
16
(
res
);
res
=
(
unsigned
short
)(((
le2ne_
16
(((
unsigned
short
*
)
ref_lp
)[
1
])
>>
1
)
+
lv2
)
<<
1
);
((
unsigned
short
*
)
cur_lp
)[
1
]
=
le2ne_
16
(
res
);
res
=
(
unsigned
short
)(((
le2ne_
16
(((
unsigned
short
*
)
ref_lp
)[
width_tbl
[
2
]])
>>
1
)
+
lv1
)
<<
1
);
((
unsigned
short
*
)
cur_lp
)[
width_tbl
[
2
]]
=
le2ne_
16
(
res
);
res
=
(
unsigned
short
)(((
le2ne_
16
(((
unsigned
short
*
)
ref_lp
)[
width_tbl
[
2
]
+
1
])
>>
1
)
+
lv2
)
<<
1
);
((
unsigned
short
*
)
cur_lp
)[
width_tbl
[
2
]
+
1
]
=
le2ne_
16
(
res
);
res
=
(
unsigned
short
)(((
av_le2ne
16
(((
unsigned
short
*
)
ref_lp
)[
0
])
>>
1
)
+
lv1
)
<<
1
);
((
unsigned
short
*
)
cur_lp
)[
0
]
=
av_le2ne
16
(
res
);
res
=
(
unsigned
short
)(((
av_le2ne
16
(((
unsigned
short
*
)
ref_lp
)[
1
])
>>
1
)
+
lv2
)
<<
1
);
((
unsigned
short
*
)
cur_lp
)[
1
]
=
av_le2ne
16
(
res
);
res
=
(
unsigned
short
)(((
av_le2ne
16
(((
unsigned
short
*
)
ref_lp
)[
width_tbl
[
2
]])
>>
1
)
+
lv1
)
<<
1
);
((
unsigned
short
*
)
cur_lp
)[
width_tbl
[
2
]]
=
av_le2ne
16
(
res
);
res
=
(
unsigned
short
)(((
av_le2ne
16
(((
unsigned
short
*
)
ref_lp
)[
width_tbl
[
2
]
+
1
])
>>
1
)
+
lv2
)
<<
1
);
((
unsigned
short
*
)
cur_lp
)[
width_tbl
[
2
]
+
1
]
=
av_le2ne
16
(
res
);
lp2
++
;
break
;
...
...
libavcodec/mjpegdec.c
浏览文件 @
8fc0162a
...
...
@@ -1027,7 +1027,7 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
return
-
1
;
id
=
(
get_bits
(
&
s
->
gb
,
16
)
<<
16
)
|
get_bits
(
&
s
->
gb
,
16
);
id
=
be2ne_
32
(
id
);
id
=
av_be2ne
32
(
id
);
len
-=
6
;
if
(
s
->
avctx
->
debug
&
FF_DEBUG_STARTCODE
){
...
...
@@ -1134,7 +1134,7 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
if
((
s
->
start_code
==
APP1
)
&&
(
len
>
(
0x28
-
8
)))
{
id
=
(
get_bits
(
&
s
->
gb
,
16
)
<<
16
)
|
get_bits
(
&
s
->
gb
,
16
);
id
=
be2ne_
32
(
id
);
id
=
av_be2ne
32
(
id
);
len
-=
4
;
if
(
id
==
AV_RL32
(
"mjpg"
))
/* Apple MJPEG-A */
{
...
...
libavcodec/pngdec.c
浏览文件 @
8fc0162a
...
...
@@ -429,7 +429,7 @@ static int decode_frame(AVCodecContext *avctx,
if
(
length
>
0x7fffffff
)
goto
fail
;
tag32
=
bytestream_get_be32
(
&
s
->
bytestream
);
tag
=
bswap_
32
(
tag32
);
tag
=
av_bswap
32
(
tag32
);
dprintf
(
avctx
,
"png: tag=%c%c%c%c length=%u
\n
"
,
(
tag
&
0xff
),
((
tag
>>
8
)
&
0xff
),
...
...
libavcodec/pngenc.c
浏览文件 @
8fc0162a
...
...
@@ -199,7 +199,7 @@ static void png_write_chunk(uint8_t **f, uint32_t tag,
crc
=
crc32
(
0
,
Z_NULL
,
0
);
AV_WL32
(
tagbuf
,
tag
);
crc
=
crc32
(
crc
,
tagbuf
,
4
);
bytestream_put_be32
(
f
,
bswap_
32
(
tag
));
bytestream_put_be32
(
f
,
av_bswap
32
(
tag
));
if
(
length
>
0
)
{
crc
=
crc32
(
crc
,
buf
,
length
);
memcpy
(
*
f
,
buf
,
length
);
...
...
libavcodec/pnmdec.c
浏览文件 @
8fc0162a
...
...
@@ -124,7 +124,7 @@ static int pnm_decode_frame(AVCodecContext *avctx, void *data,
}
else
if
(
upgrade
==
2
)
{
unsigned
int
j
,
v
,
f
=
(
65535
*
32768
+
s
->
maxval
/
2
)
/
s
->
maxval
;
for
(
j
=
0
;
j
<
n
/
2
;
j
++
)
{
v
=
be2ne_
16
(((
uint16_t
*
)
s
->
bytestream
)[
j
]);
v
=
av_be2ne
16
(((
uint16_t
*
)
s
->
bytestream
)[
j
]);
((
uint16_t
*
)
ptr
)[
j
]
=
(
v
*
f
+
16384
)
>>
15
;
}
}
...
...
libavcodec/put_bits.h
浏览文件 @
8fc0162a
...
...
@@ -168,7 +168,7 @@ static inline void put_bits(PutBitContext *s, int n, unsigned int value)
AV_WL32
(
s
->
buf_ptr
,
bit_buf
);
}
else
#endif
*
(
uint32_t
*
)
s
->
buf_ptr
=
le2ne_
32
(
bit_buf
);
*
(
uint32_t
*
)
s
->
buf_ptr
=
av_le2ne
32
(
bit_buf
);
s
->
buf_ptr
+=
4
;
bit_buf
=
(
bit_left
==
32
)
?
0
:
value
>>
bit_left
;
bit_left
+=
32
;
...
...
@@ -186,7 +186,7 @@ static inline void put_bits(PutBitContext *s, int n, unsigned int value)
AV_WB32
(
s
->
buf_ptr
,
bit_buf
);
}
else
#endif
*
(
uint32_t
*
)
s
->
buf_ptr
=
be2ne_
32
(
bit_buf
);
*
(
uint32_t
*
)
s
->
buf_ptr
=
av_be2ne
32
(
bit_buf
);
//printf("bitbuf = %08x\n", bit_buf);
s
->
buf_ptr
+=
4
;
bit_left
+=
32
-
n
;
...
...
@@ -224,8 +224,8 @@ static inline void put_bits(PutBitContext *s, int n, unsigned int value)
value
<<=
32
-
n
;
ptr
[
0
]
|=
be2ne_
32
(
value
>>
(
index
&
31
));
ptr
[
1
]
=
be2ne_
32
(
value
<<
(
32
-
(
index
&
31
)));
ptr
[
0
]
|=
av_be2ne
32
(
value
>>
(
index
&
31
));
ptr
[
1
]
=
av_be2ne
32
(
value
<<
(
32
-
(
index
&
31
)));
//if(n>24) printf("%d %d\n", n, value);
index
+=
n
;
s
->
index
=
index
;
...
...
@@ -252,7 +252,7 @@ static inline void put_bits(PutBitContext *s, int n, unsigned int value)
int
index
=
s
->
index
;
uint32_t
*
ptr
=
(
uint32_t
*
)(((
uint8_t
*
)
s
->
buf
)
+
(
index
>>
3
));
ptr
[
0
]
|=
be2ne_
32
(
value
<<
(
32
-
n
-
(
index
&
7
)
));
ptr
[
0
]
|=
av_be2ne
32
(
value
<<
(
32
-
n
-
(
index
&
7
)
));
ptr
[
1
]
=
0
;
//if(n>24) printf("%d %d\n", n, value);
index
+=
n
;
...
...
libavcodec/r210dec.c
浏览文件 @
8fc0162a
...
...
@@ -61,7 +61,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
for
(
h
=
0
;
h
<
avctx
->
height
;
h
++
)
{
uint16_t
*
dst
=
(
uint16_t
*
)
dst_line
;
for
(
w
=
0
;
w
<
avctx
->
width
;
w
++
)
{
uint32_t
pixel
=
be2ne_
32
(
*
src
++
);
uint32_t
pixel
=
av_be2ne
32
(
*
src
++
);
uint16_t
r
,
g
,
b
;
b
=
pixel
<<
6
;
g
=
(
pixel
>>
4
)
&
0xffc0
;
...
...
libavcodec/shorten.c
浏览文件 @
8fc0162a
...
...
@@ -184,12 +184,12 @@ static void init_offset(ShortenContext *s)
static
inline
int
get_le32
(
GetBitContext
*
gb
)
{
return
bswap_
32
(
get_bits_long
(
gb
,
32
));
return
av_bswap
32
(
get_bits_long
(
gb
,
32
));
}
static
inline
short
get_le16
(
GetBitContext
*
gb
)
{
return
bswap_
16
(
get_bits_long
(
gb
,
16
));
return
av_bswap
16
(
get_bits_long
(
gb
,
16
));
}
static
int
decode_wave_header
(
AVCodecContext
*
avctx
,
uint8_t
*
header
,
int
header_size
)
...
...
libavcodec/smacker.c
浏览文件 @
8fc0162a
...
...
@@ -618,7 +618,7 @@ static int smka_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
}
if
(
bits
)
{
//decode 16-bit data
for
(
i
=
stereo
;
i
>=
0
;
i
--
)
pred
[
i
]
=
bswap_
16
(
get_bits
(
&
gb
,
16
));
pred
[
i
]
=
av_bswap
16
(
get_bits
(
&
gb
,
16
));
for
(
i
=
0
;
i
<
stereo
;
i
++
)
*
samples
++
=
pred
[
i
];
for
(
i
=
0
;
i
<
unp_size
/
2
;
i
++
)
{
...
...
libavcodec/tta.c
浏览文件 @
8fc0162a
...
...
@@ -221,7 +221,7 @@ static av_cold int tta_decode_init(AVCodecContext * avctx)
{
/* signature */
skip_bits
(
&
s
->
gb
,
32
);
// if (get_bits_long(&s->gb, 32) !=
bswap_
32(AV_RL32("TTA1"))) {
// if (get_bits_long(&s->gb, 32) !=
av_bswap
32(AV_RL32("TTA1"))) {
// av_log(s->avctx, AV_LOG_ERROR, "Missing magic\n");
// return -1;
// }
...
...
libavcodec/v210dec.c
浏览文件 @
8fc0162a
...
...
@@ -68,7 +68,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
#define READ_PIXELS(a, b, c) \
do { \
val =
le2ne_
32(*src++); \
val =
av_le2ne
32(*src++); \
*a++ = val << 6; \
*b++ = (val >> 4) & 0xFFC0; \
*c++ = (val >> 14) & 0xFFC0; \
...
...
@@ -86,14 +86,14 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
if
(
w
<
avctx
->
width
-
1
)
{
READ_PIXELS
(
u
,
y
,
v
);
val
=
le2ne_
32
(
*
src
++
);
val
=
av_le2ne
32
(
*
src
++
);
*
y
++
=
val
<<
6
;
}
if
(
w
<
avctx
->
width
-
3
)
{
*
u
++
=
(
val
>>
4
)
&
0xFFC0
;
*
y
++
=
(
val
>>
14
)
&
0xFFC0
;
val
=
le2ne_
32
(
*
src
++
);
val
=
av_le2ne
32
(
*
src
++
);
*
v
++
=
val
<<
6
;
*
y
++
=
(
val
>>
4
)
&
0xFFC0
;
}
...
...
libavcodec/v210x.c
浏览文件 @
8fc0162a
...
...
@@ -67,12 +67,12 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
pic
->
key_frame
=
1
;
for
(;;){
uint32_t
v
=
be2ne_
32
(
*
src
++
);
uint32_t
v
=
av_be2ne
32
(
*
src
++
);
*
udst
++=
(
v
>>
16
)
&
0xFFC0
;
*
ydst
++=
(
v
>>
6
)
&
0xFFC0
;
*
vdst
++=
(
v
<<
4
)
&
0xFFC0
;
v
=
be2ne_
32
(
*
src
++
);
v
=
av_be2ne
32
(
*
src
++
);
*
ydst
++=
(
v
>>
16
)
&
0xFFC0
;
if
(
ydst
>=
yend
){
...
...
@@ -87,7 +87,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
*
udst
++=
(
v
>>
6
)
&
0xFFC0
;
*
ydst
++=
(
v
<<
4
)
&
0xFFC0
;
v
=
be2ne_
32
(
*
src
++
);
v
=
av_be2ne
32
(
*
src
++
);
*
vdst
++=
(
v
>>
16
)
&
0xFFC0
;
*
ydst
++=
(
v
>>
6
)
&
0xFFC0
;
...
...
@@ -102,7 +102,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
*
udst
++=
(
v
<<
4
)
&
0xFFC0
;
v
=
be2ne_
32
(
*
src
++
);
v
=
av_be2ne
32
(
*
src
++
);
*
ydst
++=
(
v
>>
16
)
&
0xFFC0
;
*
vdst
++=
(
v
>>
6
)
&
0xFFC0
;
*
ydst
++=
(
v
<<
4
)
&
0xFFC0
;
...
...
libavformat/asfcrypt.c
浏览文件 @
8fc0162a
...
...
@@ -170,7 +170,7 @@ void ff_asfcrypt_dec(const uint8_t key[20], uint8_t *data, int len) {
ms_state
=
multiswap_enc
(
ms_keys
,
ms_state
,
AV_RL64
(
qwords
));
multiswap_invert_keys
(
ms_keys
);
packetkey
=
(
packetkey
<<
32
)
|
(
packetkey
>>
32
);
packetkey
=
le2ne_
64
(
packetkey
);
packetkey
=
av_le2ne
64
(
packetkey
);
packetkey
=
multiswap_dec
(
ms_keys
,
ms_state
,
packetkey
);
AV_WL64
(
qwords
,
packetkey
);
}
libavformat/asfdec.c
浏览文件 @
8fc0162a
...
...
@@ -386,7 +386,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
st
->
codec
->
palctrl
=
av_mallocz
(
sizeof
(
AVPaletteControl
));
#if HAVE_BIGENDIAN
for
(
i
=
0
;
i
<
FFMIN
(
st
->
codec
->
extradata_size
,
AVPALETTE_SIZE
)
/
4
;
i
++
)
st
->
codec
->
palctrl
->
palette
[
i
]
=
bswap_
32
(((
uint32_t
*
)
st
->
codec
->
extradata
)[
i
]);
st
->
codec
->
palctrl
->
palette
[
i
]
=
av_bswap
32
(((
uint32_t
*
)
st
->
codec
->
extradata
)[
i
]);
#else
memcpy
(
st
->
codec
->
palctrl
->
palette
,
st
->
codec
->
extradata
,
FFMIN
(
st
->
codec
->
extradata_size
,
AVPALETTE_SIZE
));
...
...
libavformat/avidec.c
浏览文件 @
8fc0162a
...
...
@@ -539,7 +539,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
st
->
codec
->
palctrl
=
av_mallocz
(
sizeof
(
AVPaletteControl
));
#if HAVE_BIGENDIAN
for
(
i
=
0
;
i
<
FFMIN
(
st
->
codec
->
extradata_size
,
AVPALETTE_SIZE
)
/
4
;
i
++
)
st
->
codec
->
palctrl
->
palette
[
i
]
=
bswap_
32
(((
uint32_t
*
)
st
->
codec
->
extradata
)[
i
]);
st
->
codec
->
palctrl
->
palette
[
i
]
=
av_bswap
32
(((
uint32_t
*
)
st
->
codec
->
extradata
)[
i
]);
#else
memcpy
(
st
->
codec
->
palctrl
->
palette
,
st
->
codec
->
extradata
,
FFMIN
(
st
->
codec
->
extradata_size
,
AVPALETTE_SIZE
));
...
...
libavformat/electronicarts.c
浏览文件 @
8fc0162a
...
...
@@ -301,7 +301,7 @@ static int process_ea_header(AVFormatContext *s) {
if
(
i
==
0
)
ea
->
big_endian
=
size
>
0x000FFFFF
;
if
(
ea
->
big_endian
)
size
=
bswap_
32
(
size
);
size
=
av_bswap
32
(
size
);
switch
(
blockid
)
{
case
ISNh_TAG
:
...
...
libavformat/mov.c
浏览文件 @
8fc0162a
...
...
@@ -993,7 +993,7 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
st
->
codec
->
codec_tag
=
format
;
id
=
ff_codec_get_id
(
codec_movaudio_tags
,
format
);
if
(
id
<=
0
&&
((
format
&
0xFFFF
)
==
'm'
+
(
's'
<<
8
)
||
(
format
&
0xFFFF
)
==
'T'
+
(
'S'
<<
8
)))
id
=
ff_codec_get_id
(
ff_codec_wav_tags
,
bswap_
32
(
format
)
&
0xFFFF
);
id
=
ff_codec_get_id
(
ff_codec_wav_tags
,
av_bswap
32
(
format
)
&
0xFFFF
);
if
(
st
->
codec
->
codec_type
!=
AVMEDIA_TYPE_VIDEO
&&
id
>
0
)
{
st
->
codec
->
codec_type
=
AVMEDIA_TYPE_AUDIO
;
...
...
libavformat/mpegtsenc.c
浏览文件 @
8fc0162a
...
...
@@ -74,7 +74,7 @@ static void mpegts_write_section(MpegTSSection *s, uint8_t *buf, int len)
unsigned
char
*
q
;
int
first
,
b
,
len1
,
left
;
crc
=
bswap_
32
(
av_crc
(
av_crc_get_table
(
AV_CRC_32_IEEE
),
-
1
,
buf
,
len
-
4
));
crc
=
av_bswap
32
(
av_crc
(
av_crc_get_table
(
AV_CRC_32_IEEE
),
-
1
,
buf
,
len
-
4
));
buf
[
len
-
4
]
=
(
crc
>>
24
)
&
0xff
;
buf
[
len
-
3
]
=
(
crc
>>
16
)
&
0xff
;
buf
[
len
-
2
]
=
(
crc
>>
8
)
&
0xff
;
...
...
libavformat/mtv.c
浏览文件 @
8fc0162a
...
...
@@ -188,7 +188,7 @@ static int mtv_read_packet(AVFormatContext *s, AVPacket *pkt)
*/
for
(
i
=
0
;
i
<
mtv
->
img_segment_size
/
2
;
i
++
)
*
((
uint16_t
*
)
pkt
->
data
+
i
)
=
bswap_
16
(
*
((
uint16_t
*
)
pkt
->
data
+
i
));
*
((
uint16_t
*
)
pkt
->
data
+
i
)
=
av_bswap
16
(
*
((
uint16_t
*
)
pkt
->
data
+
i
));
#endif
pkt
->
stream_index
=
VIDEO_SID
;
}
...
...
libavformat/nutdec.c
浏览文件 @
8fc0162a
...
...
@@ -94,7 +94,7 @@ static int get_packetheader(NUTContext *nut, ByteIOContext *bc, int calculate_ch
int64_t
size
;
// start= url_ftell(bc) - 8;
startcode
=
be2ne_
64
(
startcode
);
startcode
=
av_be2ne
64
(
startcode
);
startcode
=
ff_crc04C11DB7_update
(
0
,
(
uint8_t
*
)
&
startcode
,
8
);
init_checksum
(
bc
,
ff_crc04C11DB7_update
,
startcode
);
...
...
libavformat/smacker.c
浏览文件 @
8fc0162a
...
...
@@ -213,10 +213,10 @@ static int smacker_read_header(AVFormatContext *s, AVFormatParameters *ap)
av_free
(
smk
->
frm_flags
);
return
AVERROR
(
EIO
);
}
((
int32_t
*
)
st
->
codec
->
extradata
)[
0
]
=
le2ne_
32
(
smk
->
mmap_size
);
((
int32_t
*
)
st
->
codec
->
extradata
)[
1
]
=
le2ne_
32
(
smk
->
mclr_size
);
((
int32_t
*
)
st
->
codec
->
extradata
)[
2
]
=
le2ne_
32
(
smk
->
full_size
);
((
int32_t
*
)
st
->
codec
->
extradata
)[
3
]
=
le2ne_
32
(
smk
->
type_size
);
((
int32_t
*
)
st
->
codec
->
extradata
)[
0
]
=
av_le2ne
32
(
smk
->
mmap_size
);
((
int32_t
*
)
st
->
codec
->
extradata
)[
1
]
=
av_le2ne
32
(
smk
->
mclr_size
);
((
int32_t
*
)
st
->
codec
->
extradata
)[
2
]
=
av_le2ne
32
(
smk
->
full_size
);
((
int32_t
*
)
st
->
codec
->
extradata
)[
3
]
=
av_le2ne
32
(
smk
->
type_size
);
smk
->
curstream
=
-
1
;
smk
->
nextpos
=
url_ftell
(
pb
);
...
...
libavformat/sol.c
浏览文件 @
8fc0162a
...
...
@@ -34,7 +34,7 @@ static int sol_probe(AVProbeData *p)
{
/* check file header */
uint16_t
magic
;
magic
=
le2ne_
16
(
*
((
uint16_t
*
)
p
->
buf
));
magic
=
av_le2ne
16
(
*
((
uint16_t
*
)
p
->
buf
));
if
((
magic
==
0x0B8D
||
magic
==
0x0C0D
||
magic
==
0x0C8D
)
&&
p
->
buf
[
2
]
==
'S'
&&
p
->
buf
[
3
]
==
'O'
&&
p
->
buf
[
4
]
==
'L'
&&
p
->
buf
[
5
]
==
0
)
...
...
libavformat/spdif.c
浏览文件 @
8fc0162a
...
...
@@ -90,17 +90,17 @@ static void bswap_buf16(uint16_t *dst, const uint16_t *src, int w)
int
i
;
for
(
i
=
0
;
i
+
8
<=
w
;
i
+=
8
)
{
dst
[
i
+
0
]
=
bswap_
16
(
src
[
i
+
0
]);
dst
[
i
+
1
]
=
bswap_
16
(
src
[
i
+
1
]);
dst
[
i
+
2
]
=
bswap_
16
(
src
[
i
+
2
]);
dst
[
i
+
3
]
=
bswap_
16
(
src
[
i
+
3
]);
dst
[
i
+
4
]
=
bswap_
16
(
src
[
i
+
4
]);
dst
[
i
+
5
]
=
bswap_
16
(
src
[
i
+
5
]);
dst
[
i
+
6
]
=
bswap_
16
(
src
[
i
+
6
]);
dst
[
i
+
7
]
=
bswap_
16
(
src
[
i
+
7
]);
dst
[
i
+
0
]
=
av_bswap
16
(
src
[
i
+
0
]);
dst
[
i
+
1
]
=
av_bswap
16
(
src
[
i
+
1
]);
dst
[
i
+
2
]
=
av_bswap
16
(
src
[
i
+
2
]);
dst
[
i
+
3
]
=
av_bswap
16
(
src
[
i
+
3
]);
dst
[
i
+
4
]
=
av_bswap
16
(
src
[
i
+
4
]);
dst
[
i
+
5
]
=
av_bswap
16
(
src
[
i
+
5
]);
dst
[
i
+
6
]
=
av_bswap
16
(
src
[
i
+
6
]);
dst
[
i
+
7
]
=
av_bswap
16
(
src
[
i
+
7
]);
}
for
(;
i
<
w
;
i
++
)
dst
[
i
+
0
]
=
bswap_
16
(
src
[
i
+
0
]);
dst
[
i
+
0
]
=
av_bswap
16
(
src
[
i
+
0
]);
}
static
int
spdif_header_ac3
(
AVFormatContext
*
s
,
AVPacket
*
pkt
)
...
...
libavutil/arm/bswap.h
浏览文件 @
8fc0162a
...
...
@@ -26,15 +26,15 @@
#ifdef __ARMCC_VERSION
#if HAVE_ARMV6
#define
bswap_16 bswap_
16
static
av_always_inline
av_const
unsigned
bswap_
16
(
unsigned
x
)
#define
av_bswap16 av_bswap
16
static
av_always_inline
av_const
unsigned
av_bswap
16
(
unsigned
x
)
{
__asm
{
rev16
x
,
x
}
return
x
;
}
#define
bswap_32 bswap_
32
static
av_always_inline
av_const
uint32_t
bswap_
32
(
uint32_t
x
)
#define
av_bswap32 av_bswap
32
static
av_always_inline
av_const
uint32_t
av_bswap
32
(
uint32_t
x
)
{
return
__rev
(
x
);
}
...
...
@@ -43,16 +43,16 @@ static av_always_inline av_const uint32_t bswap_32(uint32_t x)
#elif HAVE_INLINE_ASM
#if HAVE_ARMV6
#define
bswap_16 bswap_
16
static
av_always_inline
av_const
unsigned
bswap_
16
(
unsigned
x
)
#define
av_bswap16 av_bswap
16
static
av_always_inline
av_const
unsigned
av_bswap
16
(
unsigned
x
)
{
__asm__
(
"rev16 %0, %0"
:
"+r"
(
x
));
return
x
;
}
#endif
#define
bswap_32 bswap_
32
static
av_always_inline
av_const
uint32_t
bswap_
32
(
uint32_t
x
)
#define
av_bswap32 av_bswap
32
static
av_always_inline
av_const
uint32_t
av_bswap
32
(
uint32_t
x
)
{
#if HAVE_ARMV6
__asm__
(
"rev %0, %0"
:
"+r"
(
x
));
...
...
libavutil/avr32/bswap.h
浏览文件 @
8fc0162a
...
...
@@ -25,15 +25,15 @@
#if HAVE_INLINE_ASM
#define
bswap_16 bswap_
16
static
av_always_inline
av_const
uint16_t
bswap_
16
(
uint16_t
x
)
#define
av_bswap16 av_bswap
16
static
av_always_inline
av_const
uint16_t
av_bswap
16
(
uint16_t
x
)
{
__asm__
(
"swap.bh %0"
:
"+r"
(
x
));
return
x
;
}
#define
bswap_32 bswap_
32
static
av_always_inline
av_const
uint32_t
bswap_
32
(
uint32_t
x
)
#define
av_bswap32 av_bswap
32
static
av_always_inline
av_const
uint32_t
av_bswap
32
(
uint32_t
x
)
{
__asm__
(
"swap.b %0"
:
"+r"
(
x
));
return
x
;
...
...
libavutil/avr32/intreadwrite.h
浏览文件 @
8fc0162a
...
...
@@ -106,8 +106,8 @@ static av_always_inline void AV_WB32(void *p, uint32_t v)
}
/* These two would be defined by generic code, but we need them sooner. */
#define AV_RL32(p)
bswap_
32(AV_RB32(p))
#define AV_WL32(p, v) AV_WB32(p,
bswap_
32(v))
#define AV_RL32(p)
av_bswap
32(AV_RB32(p))
#define AV_WL32(p, v) AV_WB32(p,
av_bswap
32(v))
#define AV_WB64 AV_WB64
static
av_always_inline
void
AV_WB64
(
void
*
p
,
uint64_t
v
)
...
...
libavutil/bfin/bswap.h
浏览文件 @
8fc0162a
...
...
@@ -30,8 +30,8 @@
#include "config.h"
#include "libavutil/attributes.h"
#define
bswap_32 bswap_
32
static
av_always_inline
av_const
uint32_t
bswap_
32
(
uint32_t
x
)
#define
av_bswap32 av_bswap
32
static
av_always_inline
av_const
uint32_t
av_bswap
32
(
uint32_t
x
)
{
unsigned
tmp
;
__asm__
(
"%1 = %0 >> 8 (V);
\n\t
"
...
...
libavutil/bswap.h
浏览文件 @
8fc0162a
...
...
@@ -48,16 +48,16 @@
#define AV_BSWAPC(s, x) AV_BSWAP##s##C(x)
#ifndef
bswap_
16
static
av_always_inline
av_const
uint16_t
bswap_
16
(
uint16_t
x
)
#ifndef
av_bswap
16
static
av_always_inline
av_const
uint16_t
av_bswap
16
(
uint16_t
x
)
{
x
=
(
x
>>
8
)
|
(
x
<<
8
);
return
x
;
}
#endif
#ifndef
bswap_
32
static
av_always_inline
av_const
uint32_t
bswap_
32
(
uint32_t
x
)
#ifndef
av_bswap
32
static
av_always_inline
av_const
uint32_t
av_bswap
32
(
uint32_t
x
)
{
x
=
((
x
<<
8
)
&
0xFF00FF00
)
|
((
x
>>
8
)
&
0x00FF00FF
);
x
=
(
x
>>
16
)
|
(
x
<<
16
);
...
...
@@ -65,8 +65,8 @@ static av_always_inline av_const uint32_t bswap_32(uint32_t x)
}
#endif
#ifndef
bswap_
64
static
inline
uint64_t
av_const
bswap_
64
(
uint64_t
x
)
#ifndef
av_bswap
64
static
inline
uint64_t
av_const
av_bswap
64
(
uint64_t
x
)
{
#if 0
x= ((x<< 8)&0xFF00FF00FF00FF00ULL) | ((x>> 8)&0x00FF00FF00FF00FFULL);
...
...
@@ -78,8 +78,8 @@ static inline uint64_t av_const bswap_64(uint64_t x)
uint32_t
l
[
2
];
}
w
,
r
;
w
.
ll
=
x
;
r
.
l
[
0
]
=
bswap_
32
(
w
.
l
[
1
]);
r
.
l
[
1
]
=
bswap_
32
(
w
.
l
[
0
]);
r
.
l
[
0
]
=
av_bswap
32
(
w
.
l
[
1
]);
r
.
l
[
1
]
=
av_bswap
32
(
w
.
l
[
0
]);
return
r
.
ll
;
#endif
}
...
...
@@ -89,21 +89,21 @@ static inline uint64_t av_const bswap_64(uint64_t x)
// le2ne ... little-endian to native-endian
#if HAVE_BIGENDIAN
#define
be2ne_
16(x) (x)
#define
be2ne_
32(x) (x)
#define
be2ne_
64(x) (x)
#define
le2ne_16(x) bswap_
16(x)
#define
le2ne_32(x) bswap_
32(x)
#define
le2ne_64(x) bswap_
64(x)
#define
av_be2ne
16(x) (x)
#define
av_be2ne
32(x) (x)
#define
av_be2ne
64(x) (x)
#define
av_le2ne16(x) av_bswap
16(x)
#define
av_le2ne32(x) av_bswap
32(x)
#define
av_le2ne64(x) av_bswap
64(x)
#define AV_BE2NEC(s, x) (x)
#define AV_LE2NEC(s, x) AV_BSWAPC(s, x)
#else
#define
be2ne_16(x) bswap_
16(x)
#define
be2ne_32(x) bswap_
32(x)
#define
be2ne_64(x) bswap_
64(x)
#define
le2ne_
16(x) (x)
#define
le2ne_
32(x) (x)
#define
le2ne_
64(x) (x)
#define
av_be2ne16(x) av_bswap
16(x)
#define
av_be2ne32(x) av_bswap
32(x)
#define
av_be2ne64(x) av_bswap
64(x)
#define
av_le2ne
16(x) (x)
#define
av_le2ne
32(x) (x)
#define
av_le2ne
64(x) (x)
#define AV_BE2NEC(s, x) AV_BSWAPC(s, x)
#define AV_LE2NEC(s, x) (x)
#endif
...
...
libavutil/crc.c
浏览文件 @
8fc0162a
...
...
@@ -49,7 +49,7 @@ static AVCRC av_crc_table[AV_CRC_MAX][257];
* If 0, you must swap the CRC parameter and the result of av_crc
* if you need the standard representation (can be simplified in
* most cases to e.g. bswap16):
*
bswap_
32(crc << (32-bits))
*
av_bswap
32(crc << (32-bits))
* @param bits number of bits for the CRC
* @param poly generator polynomial without the x**bits coefficient, in the
* representation as specified by le
...
...
@@ -73,7 +73,7 @@ int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size){
}
else
{
for
(
c
=
i
<<
24
,
j
=
0
;
j
<
8
;
j
++
)
c
=
(
c
<<
1
)
^
((
poly
<<
(
32
-
bits
))
&
(((
int32_t
)
c
)
>>
31
)
);
ctx
[
i
]
=
bswap_
32
(
c
);
ctx
[
i
]
=
av_bswap
32
(
c
);
}
}
ctx
[
256
]
=
1
;
...
...
@@ -121,7 +121,7 @@ uint32_t av_crc(const AVCRC *ctx, uint32_t crc, const uint8_t *buffer, size_t le
crc
=
ctx
[((
uint8_t
)
crc
)
^
*
buffer
++
]
^
(
crc
>>
8
);
while
(
buffer
<
end
-
3
){
crc
^=
le2ne_
32
(
*
(
const
uint32_t
*
)
buffer
);
buffer
+=
4
;
crc
^=
av_le2ne
32
(
*
(
const
uint32_t
*
)
buffer
);
buffer
+=
4
;
crc
=
ctx
[
3
*
256
+
(
crc
&
0xFF
)]
^
ctx
[
2
*
256
+
((
crc
>>
8
)
&
0xFF
)]
^
ctx
[
1
*
256
+
((
crc
>>
16
)
&
0xFF
)]
...
...
libavutil/des.c
浏览文件 @
8fc0162a
...
...
@@ -297,10 +297,10 @@ int av_des_init(AVDES *d, const uint8_t *key, int key_bits, int decrypt) {
}
void
av_des_crypt
(
AVDES
*
d
,
uint8_t
*
dst
,
const
uint8_t
*
src
,
int
count
,
uint8_t
*
iv
,
int
decrypt
)
{
uint64_t
iv_val
=
iv
?
be2ne_
64
(
*
(
uint64_t
*
)
iv
)
:
0
;
uint64_t
iv_val
=
iv
?
av_be2ne
64
(
*
(
uint64_t
*
)
iv
)
:
0
;
while
(
count
--
>
0
)
{
uint64_t
dst_val
;
uint64_t
src_val
=
src
?
be2ne_
64
(
*
(
const
uint64_t
*
)
src
)
:
0
;
uint64_t
src_val
=
src
?
av_be2ne
64
(
*
(
const
uint64_t
*
)
src
)
:
0
;
if
(
decrypt
)
{
uint64_t
tmp
=
src_val
;
if
(
d
->
triple_des
)
{
...
...
@@ -317,12 +317,12 @@ void av_des_crypt(AVDES *d, uint8_t *dst, const uint8_t *src, int count, uint8_t
}
iv_val
=
iv
?
dst_val
:
0
;
}
*
(
uint64_t
*
)
dst
=
be2ne_
64
(
dst_val
);
*
(
uint64_t
*
)
dst
=
av_be2ne
64
(
dst_val
);
src
+=
8
;
dst
+=
8
;
}
if
(
iv
)
*
(
uint64_t
*
)
iv
=
be2ne_
64
(
iv_val
);
*
(
uint64_t
*
)
iv
=
av_be2ne
64
(
iv_val
);
}
#ifdef TEST
...
...
libavutil/intreadwrite.h
浏览文件 @
8fc0162a
...
...
@@ -339,11 +339,11 @@ union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias;
#if HAVE_BIGENDIAN
# define AV_RB(s, p) AV_RN##s(p)
# define AV_WB(s, p, v) AV_WN##s(p, v)
# define AV_RL(s, p)
bswap_
##s(AV_RN##s(p))
# define AV_WL(s, p, v) AV_WN##s(p,
bswap_
##s(v))
# define AV_RL(s, p)
av_bswap
##s(AV_RN##s(p))
# define AV_WL(s, p, v) AV_WN##s(p,
av_bswap
##s(v))
#else
# define AV_RB(s, p)
bswap_
##s(AV_RN##s(p))
# define AV_WB(s, p, v) AV_WN##s(p,
bswap_
##s(v))
# define AV_RB(s, p)
av_bswap
##s(AV_RN##s(p))
# define AV_WB(s, p, v) AV_WN##s(p,
av_bswap
##s(v))
# define AV_RL(s, p) AV_RN##s(p)
# define AV_WL(s, p, v) AV_WN##s(p, v)
#endif
...
...
libavutil/md5.c
浏览文件 @
8fc0162a
...
...
@@ -95,7 +95,7 @@ static void body(uint32_t ABCD[4], uint32_t X[16]){
#if HAVE_BIGENDIAN
for
(
i
=
0
;
i
<
16
;
i
++
)
X
[
i
]
=
bswap_
32
(
X
[
i
]);
X
[
i
]
=
av_bswap
32
(
X
[
i
]);
#endif
#if CONFIG_SMALL
...
...
@@ -141,7 +141,7 @@ void av_md5_update(AVMD5 *ctx, const uint8_t *src, const int len){
void
av_md5_final
(
AVMD5
*
ctx
,
uint8_t
*
dst
){
int
i
;
uint64_t
finalcount
=
le2ne_
64
(
ctx
->
len
<<
3
);
uint64_t
finalcount
=
av_le2ne
64
(
ctx
->
len
<<
3
);
av_md5_update
(
ctx
,
"
\200
"
,
1
);
while
((
ctx
->
len
&
63
)
!=
56
)
...
...
@@ -150,7 +150,7 @@ void av_md5_final(AVMD5 *ctx, uint8_t *dst){
av_md5_update
(
ctx
,
(
uint8_t
*
)
&
finalcount
,
8
);
for
(
i
=
0
;
i
<
4
;
i
++
)
((
uint32_t
*
)
dst
)[
i
]
=
le2ne_
32
(
ctx
->
ABCD
[
3
-
i
]);
((
uint32_t
*
)
dst
)[
i
]
=
av_le2ne
32
(
ctx
->
ABCD
[
3
-
i
]);
}
void
av_md5_sum
(
uint8_t
*
dst
,
const
uint8_t
*
src
,
const
int
len
){
...
...
libavutil/sh4/bswap.h
浏览文件 @
8fc0162a
...
...
@@ -28,15 +28,15 @@
#include "config.h"
#include "libavutil/attributes.h"
#define
bswap_16 bswap_
16
static
av_always_inline
av_const
uint16_t
bswap_
16
(
uint16_t
x
)
#define
av_bswap16 av_bswap
16
static
av_always_inline
av_const
uint16_t
av_bswap
16
(
uint16_t
x
)
{
__asm__
(
"swap.b %0,%0"
:
"+r"
(
x
));
return
x
;
}
#define
bswap_32 bswap_
32
static
av_always_inline
av_const
uint32_t
bswap_
32
(
uint32_t
x
)
#define
av_bswap32 av_bswap
32
static
av_always_inline
av_const
uint32_t
av_bswap
32
(
uint32_t
x
)
{
__asm__
(
"swap.b %0,%0
\n
"
"swap.w %0,%0
\n
"
...
...
libavutil/sha.c
浏览文件 @
8fc0162a
...
...
@@ -43,7 +43,7 @@ const int av_sha_size = sizeof(AVSHA);
#define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits))))
/* (R0+R1), R2, R3, R4 are the different operations used in SHA1 */
#define blk0(i) (block[i] =
be2ne_
32(((const uint32_t*)buffer)[i]))
#define blk0(i) (block[i] =
av_be2ne
32(((const uint32_t*)buffer)[i]))
#define blk(i) (block[i] = rol(block[i-3] ^ block[i-8] ^ block[i-14] ^ block[i-16], 1))
#define R0(v,w,x,y,z,i) z += ((w&(x^y))^y) + blk0(i) + 0x5A827999 + rol(v, 5); w = rol(w, 30);
...
...
@@ -68,7 +68,7 @@ static void sha1_transform(uint32_t state[5], const uint8_t buffer[64])
for
(
i
=
0
;
i
<
80
;
i
++
)
{
int
t
;
if
(
i
<
16
)
t
=
be2ne_
32
(((
uint32_t
*
)
buffer
)[
i
]);
t
=
av_be2ne
32
(((
uint32_t
*
)
buffer
)[
i
]);
else
t
=
rol
(
block
[
i
-
3
]
^
block
[
i
-
8
]
^
block
[
i
-
14
]
^
block
[
i
-
16
],
1
);
block
[
i
]
=
t
;
...
...
@@ -314,7 +314,7 @@ void av_sha_update(AVSHA* ctx, const uint8_t* data, unsigned int len)
void
av_sha_final
(
AVSHA
*
ctx
,
uint8_t
*
digest
)
{
int
i
;
uint64_t
finalcount
=
be2ne_
64
(
ctx
->
count
<<
3
);
uint64_t
finalcount
=
av_be2ne
64
(
ctx
->
count
<<
3
);
av_sha_update
(
ctx
,
"
\200
"
,
1
);
while
((
ctx
->
count
&
63
)
!=
56
)
...
...
libavutil/x86/bswap.h
浏览文件 @
8fc0162a
...
...
@@ -28,15 +28,15 @@
#include "config.h"
#include "libavutil/attributes.h"
#define
bswap_16 bswap_
16
static
av_always_inline
av_const
uint16_t
bswap_
16
(
uint16_t
x
)
#define
av_bswap16 av_bswap
16
static
av_always_inline
av_const
uint16_t
av_bswap
16
(
uint16_t
x
)
{
__asm__
(
"rorw $8, %0"
:
"+r"
(
x
));
return
x
;
}
#define
bswap_32 bswap_
32
static
av_always_inline
av_const
uint32_t
bswap_
32
(
uint32_t
x
)
#define
av_bswap32 av_bswap
32
static
av_always_inline
av_const
uint32_t
av_bswap
32
(
uint32_t
x
)
{
#if HAVE_BSWAP
__asm__
(
"bswap %0"
:
"+r"
(
x
));
...
...
@@ -50,8 +50,8 @@ static av_always_inline av_const uint32_t bswap_32(uint32_t x)
}
#if ARCH_X86_64
#define
bswap_64 bswap_
64
static
inline
uint64_t
av_const
bswap_
64
(
uint64_t
x
)
#define
av_bswap64 av_bswap
64
static
inline
uint64_t
av_const
av_bswap
64
(
uint64_t
x
)
{
__asm__
(
"bswap %0"
:
"=r"
(
x
)
:
"0"
(
x
));
return
x
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录