Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
3c6e5a84
Commit
3c6e5a84
authored
Nov 17, 2012
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rl2: use fixed-width integer types where appropriate
parent
126abaaa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
12 deletions
+13
-12
rl2.c
libavcodec/rl2.c
+13
-12
No files found.
libavcodec/rl2.c
View file @
3c6e5a84
...
@@ -43,10 +43,10 @@ typedef struct Rl2Context {
...
@@ -43,10 +43,10 @@ typedef struct Rl2Context {
AVCodecContext
*
avctx
;
AVCodecContext
*
avctx
;
AVFrame
frame
;
AVFrame
frame
;
u
nsigned
short
video_base
;
///< initial drawing offset
u
int16_t
video_base
;
///< initial drawing offset
u
nsigned
int
clr_count
;
///< number of used colors (currently unused)
u
int32_t
clr_count
;
///< number of used colors (currently unused)
u
nsigned
char
*
back_frame
;
///< background frame
u
int8_t
*
back_frame
;
///< background frame
u
nsigned
in
t
palette
[
AVPALETTE_COUNT
];
u
int32_
t
palette
[
AVPALETTE_COUNT
];
}
Rl2Context
;
}
Rl2Context
;
/**
/**
...
@@ -58,16 +58,17 @@ typedef struct Rl2Context {
...
@@ -58,16 +58,17 @@ typedef struct Rl2Context {
* @param stride stride of the output buffer
* @param stride stride of the output buffer
* @param video_base offset of the rle data inside the frame
* @param video_base offset of the rle data inside the frame
*/
*/
static
void
rl2_rle_decode
(
Rl2Context
*
s
,
const
unsigned
char
*
in
,
int
size
,
static
void
rl2_rle_decode
(
Rl2Context
*
s
,
const
uint8_t
*
in
,
int
size
,
unsigned
char
*
out
,
int
stride
,
int
video_base
){
uint8_t
*
out
,
int
stride
,
int
video_base
)
{
int
base_x
=
video_base
%
s
->
avctx
->
width
;
int
base_x
=
video_base
%
s
->
avctx
->
width
;
int
base_y
=
video_base
/
s
->
avctx
->
width
;
int
base_y
=
video_base
/
s
->
avctx
->
width
;
int
stride_adj
=
stride
-
s
->
avctx
->
width
;
int
stride_adj
=
stride
-
s
->
avctx
->
width
;
int
i
;
int
i
;
const
u
nsigned
char
*
back_frame
=
s
->
back_frame
;
const
u
int8_t
*
back_frame
=
s
->
back_frame
;
const
u
nsigned
char
*
in_end
=
in
+
size
;
const
u
int8_t
*
in_end
=
in
+
size
;
const
u
nsigned
char
*
out_end
=
out
+
stride
*
s
->
avctx
->
height
;
const
u
int8_t
*
out_end
=
out
+
stride
*
s
->
avctx
->
height
;
u
nsigned
char
*
line_end
;
u
int8_t
*
line_end
;
/** copy start of the background frame */
/** copy start of the background frame */
for
(
i
=
0
;
i
<=
base_y
;
i
++
){
for
(
i
=
0
;
i
<=
base_y
;
i
++
){
...
@@ -82,7 +83,7 @@ static void rl2_rle_decode(Rl2Context *s,const unsigned char* in,int size,
...
@@ -82,7 +83,7 @@ static void rl2_rle_decode(Rl2Context *s,const unsigned char* in,int size,
/** decode the variable part of the frame */
/** decode the variable part of the frame */
while
(
in
<
in_end
){
while
(
in
<
in_end
){
u
nsigned
char
val
=
*
in
++
;
u
int8_t
val
=
*
in
++
;
int
len
=
1
;
int
len
=
1
;
if
(
val
>=
0x80
){
if
(
val
>=
0x80
){
if
(
in
>=
in_end
)
if
(
in
>=
in_end
)
...
@@ -160,7 +161,7 @@ static av_cold int rl2_decode_init(AVCodecContext *avctx)
...
@@ -160,7 +161,7 @@ static av_cold int rl2_decode_init(AVCodecContext *avctx)
back_size
=
avctx
->
extradata_size
-
EXTRADATA1_SIZE
;
back_size
=
avctx
->
extradata_size
-
EXTRADATA1_SIZE
;
if
(
back_size
>
0
){
if
(
back_size
>
0
){
u
nsigned
char
*
back_frame
=
av_mallocz
(
avctx
->
width
*
avctx
->
height
);
u
int8_t
*
back_frame
=
av_mallocz
(
avctx
->
width
*
avctx
->
height
);
if
(
!
back_frame
)
if
(
!
back_frame
)
return
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
rl2_rle_decode
(
s
,
avctx
->
extradata
+
EXTRADATA1_SIZE
,
back_size
,
rl2_rle_decode
(
s
,
avctx
->
extradata
+
EXTRADATA1_SIZE
,
back_size
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment