Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
external
ffmpeg
Commits
fead30d4
Commit
fead30d4
authored
Jan 19, 2007
by
Alex Beregszaszi
Browse files
rename BE/LE_8/16/32 to AV_RL/B_8/16/32
Originally committed as revision 7587 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
50eaa857
Changes
66
Hide whitespace changes
Inline
Side-by-side
libavcodec/adpcm.c
View file @
fead30d4
...
...
@@ -1100,19 +1100,19 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
}
break
;
case
CODEC_ID_ADPCM_EA
:
samples_in_chunk
=
LE_
32
(
src
);
samples_in_chunk
=
AV_RL
32
(
src
);
if
(
samples_in_chunk
>=
((
buf_size
-
12
)
*
2
))
{
src
+=
buf_size
;
break
;
}
src
+=
4
;
current_left_sample
=
(
int16_t
)
LE_
16
(
src
);
current_left_sample
=
(
int16_t
)
AV_RL
16
(
src
);
src
+=
2
;
previous_left_sample
=
(
int16_t
)
LE_
16
(
src
);
previous_left_sample
=
(
int16_t
)
AV_RL
16
(
src
);
src
+=
2
;
current_right_sample
=
(
int16_t
)
LE_
16
(
src
);
current_right_sample
=
(
int16_t
)
AV_RL
16
(
src
);
src
+=
2
;
previous_right_sample
=
(
int16_t
)
LE_
16
(
src
);
previous_right_sample
=
(
int16_t
)
AV_RL
16
(
src
);
src
+=
2
;
for
(
count1
=
0
;
count1
<
samples_in_chunk
/
28
;
count1
++
)
{
...
...
libavcodec/alac.c
View file @
fead30d4
...
...
@@ -110,11 +110,11 @@ static int alac_set_info(ALACContext *alac)
ptr
+=
4
;
/* alac */
ptr
+=
4
;
/* 0 ? */
if
(
BE_
32
(
ptr
)
>=
UINT_MAX
/
4
){
if
(
AV_RB
32
(
ptr
)
>=
UINT_MAX
/
4
){
av_log
(
alac
->
avctx
,
AV_LOG_ERROR
,
"setinfo_max_samples_per_frame too large
\n
"
);
return
-
1
;
}
alac
->
setinfo_max_samples_per_frame
=
BE_
32
(
ptr
);
/* buffer size / 2 ? */
alac
->
setinfo_max_samples_per_frame
=
AV_RB
32
(
ptr
);
/* buffer size / 2 ? */
ptr
+=
4
;
alac
->
setinfo_7a
=
*
ptr
++
;
alac
->
setinfo_sample_size
=
*
ptr
++
;
...
...
@@ -122,13 +122,13 @@ static int alac_set_info(ALACContext *alac)
alac
->
setinfo_rice_initialhistory
=
*
ptr
++
;
alac
->
setinfo_rice_kmodifier
=
*
ptr
++
;
alac
->
setinfo_7f
=
*
ptr
++
;
// channels?
alac
->
setinfo_80
=
BE_
16
(
ptr
);
alac
->
setinfo_80
=
AV_RB
16
(
ptr
);
ptr
+=
2
;
alac
->
setinfo_82
=
BE_
32
(
ptr
);
// max coded frame size
alac
->
setinfo_82
=
AV_RB
32
(
ptr
);
// max coded frame size
ptr
+=
4
;
alac
->
setinfo_86
=
BE_
32
(
ptr
);
// bitrate ?
alac
->
setinfo_86
=
AV_RB
32
(
ptr
);
// bitrate ?
ptr
+=
4
;
alac
->
setinfo_8a_rate
=
BE_
32
(
ptr
);
// samplerate
alac
->
setinfo_8a_rate
=
AV_RB
32
(
ptr
);
// samplerate
ptr
+=
4
;
allocate_buffers
(
alac
);
...
...
libavcodec/avs.c
View file @
fead30d4
...
...
@@ -74,8 +74,8 @@ avs_decode_frame(AVCodecContext * avctx,
int
first
,
last
;
uint32_t
*
pal
=
(
uint32_t
*
)
avs
->
picture
.
data
[
1
];
first
=
LE_
16
(
buf
);
last
=
first
+
LE_
16
(
buf
+
2
);
first
=
AV_RL
16
(
buf
);
last
=
first
+
AV_RL
16
(
buf
+
2
);
buf
+=
4
;
for
(
i
=
first
;
i
<
last
;
i
++
,
buf
+=
3
)
pal
[
i
]
=
(
buf
[
0
]
<<
18
)
|
(
buf
[
1
]
<<
10
)
|
(
buf
[
2
]
<<
2
);
...
...
libavcodec/bitstream_filter.c
View file @
fead30d4
...
...
@@ -138,7 +138,7 @@ static int mp3_header_compress(AVBitStreamFilterContext *bsfc, AVCodecContext *a
return
-
1
;
}
header
=
BE_
32
(
buf
);
header
=
AV_RB
32
(
buf
);
mode_extension
=
(
header
>>
4
)
&
3
;
if
(
ff_mpa_check_header
(
header
)
<
0
||
(
header
&
0x60000
)
!=
0x20000
){
...
...
@@ -160,7 +160,7 @@ output_unchanged:
av_log
(
avctx
,
AV_LOG_ERROR
,
"Extradata invalid
\n
"
);
return
-
1
;
}
extraheader
=
BE_
32
(
avctx
->
extradata
+
11
);
extraheader
=
AV_RB
32
(
avctx
->
extradata
+
11
);
if
((
extraheader
&
MP3_MASK
)
!=
(
header
&
MP3_MASK
))
goto
output_unchanged
;
...
...
@@ -192,7 +192,7 @@ static int mp3_header_decompress(AVBitStreamFilterContext *bsfc, AVCodecContext
int
sample_rate_index
=
0
;
int
lsf
,
mpeg25
,
bitrate_index
,
frame_size
;
header
=
BE_
32
(
buf
);
header
=
AV_RB
32
(
buf
);
if
(
ff_mpa_check_header
(
header
)
>=
0
){
*
poutbuf
=
(
uint8_t
*
)
buf
;
*
poutbuf_size
=
buf_size
;
...
...
@@ -205,7 +205,7 @@ static int mp3_header_decompress(AVBitStreamFilterContext *bsfc, AVCodecContext
return
-
1
;
}
header
=
BE_
32
(
avctx
->
extradata
+
11
)
&
MP3_MASK
;
header
=
AV_RB
32
(
avctx
->
extradata
+
11
)
&
MP3_MASK
;
lsf
=
sample_rate
<
(
24000
+
32000
)
/
2
;
mpeg25
=
sample_rate
<
(
12000
+
16000
)
/
2
;
...
...
libavcodec/bytestream.h
View file @
fead30d4
...
...
@@ -25,13 +25,13 @@
static
av_always_inline
unsigned
int
bytestream_get_le32
(
uint8_t
**
b
)
{
(
*
b
)
+=
4
;
return
LE_
32
(
*
b
-
4
);
return
AV_RL
32
(
*
b
-
4
);
}
static
av_always_inline
unsigned
int
bytestream_get_le16
(
uint8_t
**
b
)
{
(
*
b
)
+=
2
;
return
LE_
16
(
*
b
-
2
);
return
AV_RL
16
(
*
b
-
2
);
}
static
av_always_inline
unsigned
int
bytestream_get_byte
(
uint8_t
**
b
)
...
...
libavcodec/cinepak.c
View file @
fead30d4
...
...
@@ -90,7 +90,7 @@ static void cinepak_decode_codebook (cvid_codebook_t *codebook,
if
((
data
+
4
)
>
eod
)
break
;
flag
=
BE_
32
(
data
);
flag
=
AV_RB
32
(
data
);
data
+=
4
;
mask
=
0x80000000
;
}
...
...
@@ -152,7 +152,7 @@ static int cinepak_decode_vectors (CinepakContext *s, cvid_strip_t *strip,
if
((
data
+
4
)
>
eod
)
return
-
1
;
flag
=
BE_
32
(
data
);
flag
=
AV_RB
32
(
data
);
data
+=
4
;
mask
=
0x80000000
;
}
...
...
@@ -162,7 +162,7 @@ static int cinepak_decode_vectors (CinepakContext *s, cvid_strip_t *strip,
if
((
data
+
4
)
>
eod
)
return
-
1
;
flag
=
BE_
32
(
data
);
flag
=
AV_RB
32
(
data
);
data
+=
4
;
mask
=
0x80000000
;
}
...
...
@@ -278,8 +278,8 @@ static int cinepak_decode_strip (CinepakContext *s,
return
-
1
;
while
((
data
+
4
)
<=
eod
)
{
chunk_id
=
BE_
16
(
&
data
[
0
]);
chunk_size
=
BE_
16
(
&
data
[
2
])
-
4
;
chunk_id
=
AV_RB
16
(
&
data
[
0
]);
chunk_size
=
AV_RB
16
(
&
data
[
2
])
-
4
;
if
(
chunk_size
<
0
)
return
-
1
;
...
...
@@ -328,8 +328,8 @@ static int cinepak_decode (CinepakContext *s)
return
-
1
;
frame_flags
=
s
->
data
[
0
];
num_strips
=
BE_
16
(
&
s
->
data
[
8
]);
encoded_buf_size
=
((
s
->
data
[
1
]
<<
16
)
|
BE_
16
(
&
s
->
data
[
2
]));
num_strips
=
AV_RB
16
(
&
s
->
data
[
8
]);
encoded_buf_size
=
((
s
->
data
[
1
]
<<
16
)
|
AV_RB
16
(
&
s
->
data
[
2
]));
/* if this is the first frame, check for deviant Sega FILM data */
if
(
s
->
sega_film_skip_bytes
==
-
1
)
{
...
...
@@ -361,13 +361,13 @@ static int cinepak_decode (CinepakContext *s)
if
((
s
->
data
+
12
)
>
eod
)
return
-
1
;
s
->
strips
[
i
].
id
=
BE_
16
(
s
->
data
);
s
->
strips
[
i
].
id
=
AV_RB
16
(
s
->
data
);
s
->
strips
[
i
].
y1
=
y0
;
s
->
strips
[
i
].
x1
=
0
;
s
->
strips
[
i
].
y2
=
y0
+
BE_
16
(
&
s
->
data
[
8
]);
s
->
strips
[
i
].
y2
=
y0
+
AV_RB
16
(
&
s
->
data
[
8
]);
s
->
strips
[
i
].
x2
=
s
->
avctx
->
width
;
strip_size
=
BE_
16
(
&
s
->
data
[
2
])
-
12
;
strip_size
=
AV_RB
16
(
&
s
->
data
[
2
])
-
12
;
s
->
data
+=
12
;
strip_size
=
((
s
->
data
+
strip_size
)
>
eod
)
?
(
eod
-
s
->
data
)
:
strip_size
;
...
...
libavcodec/dpcm.c
View file @
fead30d4
...
...
@@ -179,7 +179,7 @@ static int dpcm_decode_frame(AVCodecContext *avctx,
case
CODEC_ID_ROQ_DPCM
:
if
(
s
->
channels
==
1
)
predictor
[
0
]
=
LE_
16
(
&
buf
[
6
]);
predictor
[
0
]
=
AV_RL
16
(
&
buf
[
6
]);
else
{
predictor
[
0
]
=
buf
[
7
]
<<
8
;
predictor
[
1
]
=
buf
[
6
]
<<
8
;
...
...
@@ -200,12 +200,12 @@ static int dpcm_decode_frame(AVCodecContext *avctx,
case
CODEC_ID_INTERPLAY_DPCM
:
in
=
6
;
/* skip over the stream mask and stream length */
predictor
[
0
]
=
LE_
16
(
&
buf
[
in
]);
predictor
[
0
]
=
AV_RL
16
(
&
buf
[
in
]);
in
+=
2
;
SE_16BIT
(
predictor
[
0
])
output_samples
[
out
++
]
=
predictor
[
0
];
if
(
s
->
channels
==
2
)
{
predictor
[
1
]
=
LE_
16
(
&
buf
[
in
]);
predictor
[
1
]
=
AV_RL
16
(
&
buf
[
in
]);
in
+=
2
;
SE_16BIT
(
predictor
[
1
])
output_samples
[
out
++
]
=
predictor
[
1
];
...
...
@@ -225,11 +225,11 @@ static int dpcm_decode_frame(AVCodecContext *avctx,
case
CODEC_ID_XAN_DPCM
:
in
=
0
;
shift
[
0
]
=
shift
[
1
]
=
4
;
predictor
[
0
]
=
LE_
16
(
&
buf
[
in
]);
predictor
[
0
]
=
AV_RL
16
(
&
buf
[
in
]);
in
+=
2
;
SE_16BIT
(
predictor
[
0
]);
if
(
s
->
channels
==
2
)
{
predictor
[
1
]
=
LE_
16
(
&
buf
[
in
]);
predictor
[
1
]
=
AV_RL
16
(
&
buf
[
in
]);
in
+=
2
;
SE_16BIT
(
predictor
[
1
]);
}
...
...
libavcodec/dsicinav.c
View file @
fead30d4
...
...
@@ -159,7 +159,7 @@ static void cin_decode_lzss(const unsigned char *src, int src_size, unsigned cha
if
(
code
&
(
1
<<
i
))
{
*
dst
++
=
*
src
++
;
}
else
{
cmd
=
LE_
16
(
src
);
src
+=
2
;
cmd
=
AV_RL
16
(
src
);
src
+=
2
;
offset
=
cmd
>>
4
;
sz
=
(
cmd
&
0xF
)
+
2
;
/* don't use memcpy/memmove here as the decoding routine (ab)uses */
...
...
@@ -321,7 +321,7 @@ static int cinaudio_decode_frame(AVCodecContext *avctx,
if
(
cin
->
initial_decode_frame
)
{
cin
->
initial_decode_frame
=
0
;
cin
->
delta
=
(
int16_t
)
LE_
16
(
src
);
src
+=
2
;
cin
->
delta
=
(
int16_t
)
AV_RL
16
(
src
);
src
+=
2
;
*
samples
++
=
cin
->
delta
;
buf_size
-=
2
;
}
...
...
libavcodec/dvbsubdec.c
View file @
fead30d4
...
...
@@ -851,7 +851,7 @@ static void dvbsub_parse_object_segment(AVCodecContext *avctx,
int
coding_method
,
non_modifying_colour
;
object_id
=
BE_
16
(
buf
);
object_id
=
AV_RB
16
(
buf
);
buf
+=
2
;
object
=
get_object
(
ctx
,
object_id
);
...
...
@@ -863,9 +863,9 @@ static void dvbsub_parse_object_segment(AVCodecContext *avctx,
non_modifying_colour
=
((
*
buf
++
)
>>
1
)
&
1
;
if
(
coding_method
==
0
)
{
top_field_len
=
BE_
16
(
buf
);
top_field_len
=
AV_RB
16
(
buf
);
buf
+=
2
;
bottom_field_len
=
BE_
16
(
buf
);
bottom_field_len
=
AV_RB
16
(
buf
);
buf
+=
2
;
if
(
buf
+
top_field_len
+
bottom_field_len
>
buf_end
)
{
...
...
@@ -1042,9 +1042,9 @@ static void dvbsub_parse_region_segment(AVCodecContext *avctx,
fill
=
((
*
buf
++
)
>>
3
)
&
1
;
region
->
width
=
BE_
16
(
buf
);
region
->
width
=
AV_RB
16
(
buf
);
buf
+=
2
;
region
->
height
=
BE_
16
(
buf
);
region
->
height
=
AV_RB
16
(
buf
);
buf
+=
2
;
if
(
region
->
width
*
region
->
height
!=
region
->
buf_size
)
{
...
...
@@ -1086,7 +1086,7 @@ static void dvbsub_parse_region_segment(AVCodecContext *avctx,
delete_region_display_list
(
ctx
,
region
);
while
(
buf
+
5
<
buf_end
)
{
object_id
=
BE_
16
(
buf
);
object_id
=
AV_RB
16
(
buf
);
buf
+=
2
;
object
=
get_object
(
ctx
,
object_id
);
...
...
@@ -1106,9 +1106,9 @@ static void dvbsub_parse_region_segment(AVCodecContext *avctx,
display
->
object_id
=
object_id
;
display
->
region_id
=
region_id
;
display
->
x_pos
=
BE_
16
(
buf
)
&
0xfff
;
display
->
x_pos
=
AV_RB
16
(
buf
)
&
0xfff
;
buf
+=
2
;
display
->
y_pos
=
BE_
16
(
buf
)
&
0xfff
;
display
->
y_pos
=
AV_RB
16
(
buf
)
&
0xfff
;
buf
+=
2
;
if
((
object
->
type
==
1
||
object
->
type
==
2
)
&&
buf
+
1
<
buf_end
)
{
...
...
@@ -1171,9 +1171,9 @@ static void dvbsub_parse_page_segment(AVCodecContext *avctx,
display
->
region_id
=
region_id
;
display
->
x_pos
=
BE_
16
(
buf
);
display
->
x_pos
=
AV_RB
16
(
buf
);
buf
+=
2
;
display
->
y_pos
=
BE_
16
(
buf
);
display
->
y_pos
=
AV_RB
16
(
buf
);
buf
+=
2
;
*
tmp_ptr
=
display
->
next
;
...
...
@@ -1405,9 +1405,9 @@ static int dvbsub_decode(AVCodecContext *avctx,
{
p
+=
1
;
segment_type
=
*
p
++
;
page_id
=
BE_
16
(
p
);
page_id
=
AV_RB
16
(
p
);
p
+=
2
;
segment_length
=
BE_
16
(
p
);
segment_length
=
AV_RB
16
(
p
);
p
+=
2
;
if
(
page_id
==
ctx
->
composition_id
||
page_id
==
ctx
->
ancillary_id
)
{
...
...
@@ -1576,7 +1576,7 @@ static int dvbsub_parse(AVCodecParserContext *s,
{
if
(
p
+
6
<=
p_end
)
{
len
=
BE_
16
(
p
+
4
);
len
=
AV_RB
16
(
p
+
4
);
if
(
p
+
len
+
6
<=
p_end
)
{
...
...
libavcodec/flicvideo.c
View file @
fead30d4
...
...
@@ -87,8 +87,8 @@ static int flic_decode_init(AVCodecContext *avctx)
s
->
avctx
=
avctx
;
avctx
->
has_b_frames
=
0
;
s
->
fli_type
=
LE_
16
(
&
fli_header
[
4
]);
/* Might be overridden if a Magic Carpet FLC */
depth
=
LE_
16
(
&
fli_header
[
12
]);
s
->
fli_type
=
AV_RL
16
(
&
fli_header
[
4
]);
/* Might be overridden if a Magic Carpet FLC */
depth
=
AV_RL
16
(
&
fli_header
[
12
]);
if
(
depth
==
0
)
{
depth
=
8
;
/* Some FLC generators set depth to zero, when they mean 8Bpp. Fix up here */
...
...
@@ -172,18 +172,18 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx,
pixels
=
s
->
frame
.
data
[
0
];
pixel_limit
=
s
->
avctx
->
height
*
s
->
frame
.
linesize
[
0
];
frame_size
=
LE_
32
(
&
buf
[
stream_ptr
]);
frame_size
=
AV_RL
32
(
&
buf
[
stream_ptr
]);
stream_ptr
+=
6
;
/* skip the magic number */
num_chunks
=
LE_
16
(
&
buf
[
stream_ptr
]);
num_chunks
=
AV_RL
16
(
&
buf
[
stream_ptr
]);
stream_ptr
+=
10
;
/* skip padding */
frame_size
-=
16
;
/* iterate through the chunks */
while
((
frame_size
>
0
)
&&
(
num_chunks
>
0
))
{
chunk_size
=
LE_
32
(
&
buf
[
stream_ptr
]);
chunk_size
=
AV_RL
32
(
&
buf
[
stream_ptr
]);
stream_ptr
+=
4
;
chunk_type
=
LE_
16
(
&
buf
[
stream_ptr
]);
chunk_type
=
AV_RL
16
(
&
buf
[
stream_ptr
]);
stream_ptr
+=
2
;
switch
(
chunk_type
)
{
...
...
@@ -200,7 +200,7 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx,
else
color_shift
=
2
;
/* set up the palette */
color_packets
=
LE_
16
(
&
buf
[
stream_ptr
]);
color_packets
=
AV_RL
16
(
&
buf
[
stream_ptr
]);
stream_ptr
+=
2
;
palette_ptr
=
0
;
for
(
i
=
0
;
i
<
color_packets
;
i
++
)
{
...
...
@@ -241,10 +241,10 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx,
case
FLI_DELTA
:
y_ptr
=
0
;
compressed_lines
=
LE_
16
(
&
buf
[
stream_ptr
]);
compressed_lines
=
AV_RL
16
(
&
buf
[
stream_ptr
]);
stream_ptr
+=
2
;
while
(
compressed_lines
>
0
)
{
line_packets
=
LE_
16
(
&
buf
[
stream_ptr
]);
line_packets
=
AV_RL
16
(
&
buf
[
stream_ptr
]);
stream_ptr
+=
2
;
if
((
line_packets
&
0xC000
)
==
0xC000
)
{
// line skip opcode
...
...
@@ -290,12 +290,12 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx,
case
FLI_LC
:
/* line compressed */
starting_line
=
LE_
16
(
&
buf
[
stream_ptr
]);
starting_line
=
AV_RL
16
(
&
buf
[
stream_ptr
]);
stream_ptr
+=
2
;
y_ptr
=
0
;
y_ptr
+=
starting_line
*
s
->
frame
.
linesize
[
0
];
compressed_lines
=
LE_
16
(
&
buf
[
stream_ptr
]);
compressed_lines
=
AV_RL
16
(
&
buf
[
stream_ptr
]);
stream_ptr
+=
2
;
while
(
compressed_lines
>
0
)
{
pixel_ptr
=
y_ptr
;
...
...
@@ -466,18 +466,18 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx,
pixels
=
s
->
frame
.
data
[
0
];
pixel_limit
=
s
->
avctx
->
height
*
s
->
frame
.
linesize
[
0
];
frame_size
=
LE_
32
(
&
buf
[
stream_ptr
]);
frame_size
=
AV_RL
32
(
&
buf
[
stream_ptr
]);
stream_ptr
+=
6
;
/* skip the magic number */
num_chunks
=
LE_
16
(
&
buf
[
stream_ptr
]);
num_chunks
=
AV_RL
16
(
&
buf
[
stream_ptr
]);
stream_ptr
+=
10
;
/* skip padding */
frame_size
-=
16
;
/* iterate through the chunks */
while
((
frame_size
>
0
)
&&
(
num_chunks
>
0
))
{
chunk_size
=
LE_
32
(
&
buf
[
stream_ptr
]);
chunk_size
=
AV_RL
32
(
&
buf
[
stream_ptr
]);
stream_ptr
+=
4
;
chunk_type
=
LE_
16
(
&
buf
[
stream_ptr
]);
chunk_type
=
AV_RL
16
(
&
buf
[
stream_ptr
]);
stream_ptr
+=
2
;
switch
(
chunk_type
)
{
...
...
@@ -492,10 +492,10 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx,
case
FLI_DELTA
:
case
FLI_DTA_LC
:
y_ptr
=
0
;
compressed_lines
=
LE_
16
(
&
buf
[
stream_ptr
]);
compressed_lines
=
AV_RL
16
(
&
buf
[
stream_ptr
]);
stream_ptr
+=
2
;
while
(
compressed_lines
>
0
)
{
line_packets
=
LE_
16
(
&
buf
[
stream_ptr
]);
line_packets
=
AV_RL
16
(
&
buf
[
stream_ptr
]);
stream_ptr
+=
2
;
if
(
line_packets
<
0
)
{
line_packets
=
-
line_packets
;
...
...
@@ -512,7 +512,7 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx,
byte_run
=
(
signed
char
)(
buf
[
stream_ptr
++
]);
if
(
byte_run
<
0
)
{
byte_run
=
-
byte_run
;
pixel
=
LE_
16
(
&
buf
[
stream_ptr
]);
pixel
=
AV_RL
16
(
&
buf
[
stream_ptr
]);
stream_ptr
+=
2
;
CHECK_PIXEL_PTR
(
byte_run
);
for
(
j
=
0
;
j
<
byte_run
;
j
++
,
pixel_countdown
-=
2
)
{
...
...
@@ -522,7 +522,7 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx,
}
else
{
CHECK_PIXEL_PTR
(
byte_run
);
for
(
j
=
0
;
j
<
byte_run
;
j
++
,
pixel_countdown
--
)
{
*
((
signed
short
*
)(
&
pixels
[
pixel_ptr
]))
=
LE_
16
(
&
buf
[
stream_ptr
]);
*
((
signed
short
*
)(
&
pixels
[
pixel_ptr
]))
=
AV_RL
16
(
&
buf
[
stream_ptr
]);
stream_ptr
+=
2
;
pixel_ptr
+=
2
;
}
...
...
@@ -586,12 +586,12 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx,
* a second pass over the line here, swapping the bytes.
*/
pixel
=
0xFF00
;
if
(
0xFF00
!=
LE_
16
(
&
pixel
))
/* Check if its not an LE Target */
if
(
0xFF00
!=
AV_RL
16
(
&
pixel
))
/* Check if its not an LE Target */
{
pixel_ptr
=
y_ptr
;
pixel_countdown
=
s
->
avctx
->
width
;
while
(
pixel_countdown
>
0
)
{
*
((
signed
short
*
)(
&
pixels
[
pixel_ptr
]))
=
LE_
16
(
&
buf
[
pixel_ptr
]);
*
((
signed
short
*
)(
&
pixels
[
pixel_ptr
]))
=
AV_RL
16
(
&
buf
[
pixel_ptr
]);
pixel_ptr
+=
2
;
}
}
...
...
@@ -611,7 +611,7 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx,
while
(
pixel_countdown
>
0
)
{
byte_run
=
(
signed
char
)(
buf
[
stream_ptr
++
]);
if
(
byte_run
>
0
)
{
pixel
=
LE_
16
(
&
buf
[
stream_ptr
]);
pixel
=
AV_RL
16
(
&
buf
[
stream_ptr
]);
stream_ptr
+=
2
;
CHECK_PIXEL_PTR
(
byte_run
);
for
(
j
=
0
;
j
<
byte_run
;
j
++
)
{
...
...
@@ -626,7 +626,7 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx,
byte_run
=
-
byte_run
;
CHECK_PIXEL_PTR
(
byte_run
);
for
(
j
=
0
;
j
<
byte_run
;
j
++
)
{
*
((
signed
short
*
)(
&
pixels
[
pixel_ptr
]))
=
LE_
16
(
&
buf
[
stream_ptr
]);
*
((
signed
short
*
)(
&
pixels
[
pixel_ptr
]))
=
AV_RL
16
(
&
buf
[
stream_ptr
]);
stream_ptr
+=
2
;
pixel_ptr
+=
2
;
pixel_countdown
--
;
...
...
@@ -656,7 +656,7 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx,
pixel_countdown
=
s
->
avctx
->
width
;
pixel_ptr
=
0
;
while
(
pixel_countdown
>
0
)
{
*
((
signed
short
*
)(
&
pixels
[
y_ptr
+
pixel_ptr
]))
=
LE_
16
(
&
buf
[
stream_ptr
+
pixel_ptr
]);
*
((
signed
short
*
)(
&
pixels
[
y_ptr
+
pixel_ptr
]))
=
AV_RL
16
(
&
buf
[
stream_ptr
+
pixel_ptr
]);
pixel_ptr
+=
2
;
pixel_countdown
--
;
}
...
...
libavcodec/fraps.c
View file @
fead30d4
...
...
@@ -138,7 +138,7 @@ static int fraps2_decode_plane(FrapsContext *s, uint8_t *dst, int stride, int w,
for
(
i
=
0
;
i
<
256
;
i
++
){
s
->
nodes
[
i
].
sym
=
i
;
s
->
nodes
[
i
].
count
=
LE_
32
(
src
);
s
->
nodes
[
i
].
count
=
AV_RL
32
(
src
);
s
->
nodes
[
i
].
n0
=
-
2
;
if
(
s
->
nodes
[
i
].
count
<
0
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"Symbol count < 0
\n
"
);
...
...
@@ -215,7 +215,7 @@ static int decode_frame(AVCodecContext *avctx,
int
i
,
is_chroma
,
planes
;
header
=
LE_
32
(
buf
);
header
=
AV_RL
32
(
buf
);
version
=
header
&
0xff
;
header_size
=
(
header
&
(
1
<<
30
))
?
8
:
4
;
/* bit 30 means pad to 8 bytes */
...
...
@@ -337,12 +337,12 @@ static int decode_frame(AVCodecContext *avctx,
}
f
->
pict_type
=
FF_I_TYPE
;
f
->
key_frame
=
1
;
if
((
LE_
32
(
buf
)
!=
FPS_TAG
)
||
(
buf_size
<
(
planes
*
1024
+
24
)))
{
if
((
AV_RL
32
(
buf
)
!=
FPS_TAG
)
||
(
buf_size
<
(
planes
*
1024
+
24
)))
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Fraps: error in data stream
\n
"
);
return
-
1
;
}
for
(
i
=
0
;
i
<
planes
;
i
++
)
{
offs
[
i
]
=
LE_
32
(
buf
+
4
+
i
*
4
);
offs
[
i
]
=
AV_RL
32
(
buf
+
4
+
i
*
4
);
if
(
offs
[
i
]
>=
buf_size
||
(
i
&&
offs
[
i
]
<=
offs
[
i
-
1
]
+
1024
))
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Fraps: plane %i offset is out of bounds
\n
"
,
i
);
return
-
1
;
...
...
libavcodec/h264.c
View file @
fead30d4
...
...
@@ -8215,7 +8215,7 @@ static int decode_frame(AVCodecContext *avctx,
cnt
=
*
(
p
+
5
)
&
0x1f
;
// Number of sps
p
+=
6
;
for
(
i
=
0
;
i
<
cnt
;
i
++
)
{
nalsize
=
BE_
16
(
p
)
+
2
;
nalsize
=
AV_RB
16
(
p
)
+
2
;
if
(
decode_nal_units
(
h
,
p
,
nalsize
)
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Decoding sps %d from avcC failed
\n
"
,
i
);
return
-
1
;
...
...
@@ -8225,7 +8225,7 @@ static int decode_frame(AVCodecContext *avctx,
// Decode pps from avcC
cnt
=
*
(
p
++
);
// Number of pps
for
(
i
=
0
;
i
<
cnt
;
i
++
)
{
nalsize
=
BE_
16
(
p
)
+
2
;
nalsize
=
AV_RB
16
(
p
)
+
2
;
if
(
decode_nal_units
(
h
,
p
,
nalsize
)
!=
nalsize
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Decoding pps %d from avcC failed
\n
"
,
i
);
return
-
1
;
...
...
libavcodec/kmvc.c
View file @
fead30d4
...
...
@@ -368,13 +368,13 @@ static int decode_init(AVCodecContext * avctx)
av_log
(
NULL
,
0
,
"Extradata missing, decoding may not work properly...
\n
"
);
c
->
palsize
=
127
;
}
else
{
c
->
palsize
=
LE_
16
(
avctx
->
extradata
+
10
);
c
->
palsize
=
AV_RL
16
(
avctx
->
extradata
+
10
);
}
if
(
avctx
->
extradata_size
==
1036
)
{
// palette in extradata
uint8_t
*
src
=
avctx
->
extradata
+
12
;
for
(
i
=
0
;
i
<
256
;
i
++
)
{
c
->
pal
[
i
]
=
LE_
32
(
src
);
c
->
pal
[
i
]
=
AV_RL
32
(
src
);
src
+=
4
;
}
c
->
setpal
=
1
;
...
...
libavcodec/loco.c
View file @
fead30d4
...
...
@@ -237,20 +237,20 @@ static int decode_init(AVCodecContext *avctx){
avctx
->
extradata_size
);
return
-
1
;
}
version
=
LE_
32
(
avctx
->
extradata
);
version
=
AV_RL
32
(
avctx
->
extradata
);
switch
(
version
)
{
case
1
:
l
->
lossy
=
0
;
break
;
case
2
:
l
->
lossy
=
LE_
32
(
avctx
->
extradata
+
8
);
l
->
lossy
=
AV_RL
32
(
avctx
->
extradata
+
8
);
break
;
default:
l
->
lossy
=
LE_
32
(
avctx
->
extradata
+
8
);
l
->
lossy
=
AV_RL
32
(
avctx
->
extradata
+
8
);
av_log
(
avctx
,
AV_LOG_INFO
,
"This is LOCO codec version %i, please upload file for study
\n
"
,
version
);
}
l
->
mode
=
LE_
32
(
avctx
->
extradata
+
4
);
l
->
mode
=
AV_RL
32
(
avctx
->
extradata
+
4
);
switch
(
l
->
mode
)
{
case
LOCO_CYUY2
:
case
LOCO_YUY2
:
case
LOCO_UYVY
:
avctx
->
pix_fmt
=
PIX_FMT_YUV422P
;
...
...
libavcodec/mjpeg.c
View file @
fead30d4
...
...
@@ -2540,12 +2540,12 @@ static int mjpega_dump_header(AVBitStreamFilterContext *bsfc, AVCodecContext *av
break
;
case
SOS
:
bytestream_put_be32
(
&
poutbufp
,
i
+
46
);
/* scan off */
bytestream_put_be32
(
&
poutbufp
,
i
+
46
+
BE_
16
(
buf
+
i
+
2
));
/* data off */
bytestream_put_be32
(
&
poutbufp
,
i
+
46
+
AV_RB
16
(
buf
+
i
+
2
));
/* data off */
bytestream_put_buffer
(
&
poutbufp
,
buf
+
2
,
buf_size
-
2
);
/* skip already written SOI */
*
poutbuf_size
=
poutbufp
-
*
poutbuf
;
return
1
;
case
APP1
:
if
(
i
+
8
<
buf_size
&&
LE_
32
(
buf
+
i
+
8
)
==
ff_get_fourcc
(
"mjpg"
))
{
if
(
i
+
8
<
buf_size
&&
AV_RL
32
(
buf
+
i
+
8
)
==
ff_get_fourcc
(
"mjpg"
))
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"bitstream already formatted
\n
"
);
memcpy
(
*
poutbuf
,
buf
,
buf_size
);
*
poutbuf_size
=
buf_size
;
...
...