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
4602456c
Commit
4602456c
authored
Jan 27, 2019
by
Carl Eugen Hoyos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc/arbc: Use AV_WB24() where applicable.
parent
82fd7866
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
12 deletions
+8
-12
arbc.c
libavcodec/arbc.c
+8
-12
No files found.
libavcodec/arbc.c
View file @
4602456c
...
@@ -38,7 +38,7 @@ typedef struct ARBCContext {
...
@@ -38,7 +38,7 @@ typedef struct ARBCContext {
AVFrame
*
prev_frame
;
AVFrame
*
prev_frame
;
}
ARBCContext
;
}
ARBCContext
;
static
void
fill_tile4
(
AVCodecContext
*
avctx
,
uint8_t
*
color
,
AVFrame
*
frame
)
static
void
fill_tile4
(
AVCodecContext
*
avctx
,
int
color
,
AVFrame
*
frame
)
{
{
ARBCContext
*
s
=
avctx
->
priv_data
;
ARBCContext
*
s
=
avctx
->
priv_data
;
GetByteContext
*
gb
=
&
s
->
gb
;
GetByteContext
*
gb
=
&
s
->
gb
;
...
@@ -62,9 +62,7 @@ static void fill_tile4(AVCodecContext *avctx, uint8_t *color, AVFrame *frame)
...
@@ -62,9 +62,7 @@ static void fill_tile4(AVCodecContext *avctx, uint8_t *color, AVFrame *frame)
mask
=
mask
<<
1
;
mask
=
mask
<<
1
;
continue
;
continue
;
}
}
frame
->
data
[
0
][
frame
->
linesize
[
0
]
*
(
h
-
j
)
+
3
*
k
+
0
]
=
color
[
0
];
AV_WB24
(
&
frame
->
data
[
0
][
frame
->
linesize
[
0
]
*
(
h
-
j
)
+
3
*
k
],
color
);
frame
->
data
[
0
][
frame
->
linesize
[
0
]
*
(
h
-
j
)
+
3
*
k
+
1
]
=
color
[
1
];
frame
->
data
[
0
][
frame
->
linesize
[
0
]
*
(
h
-
j
)
+
3
*
k
+
2
]
=
color
[
2
];
}
}
mask
=
mask
<<
1
;
mask
=
mask
<<
1
;
}
}
...
@@ -73,7 +71,7 @@ static void fill_tile4(AVCodecContext *avctx, uint8_t *color, AVFrame *frame)
...
@@ -73,7 +71,7 @@ static void fill_tile4(AVCodecContext *avctx, uint8_t *color, AVFrame *frame)
}
}
static
void
fill_tileX
(
AVCodecContext
*
avctx
,
int
tile_width
,
int
tile_height
,
static
void
fill_tileX
(
AVCodecContext
*
avctx
,
int
tile_width
,
int
tile_height
,
uint8_t
*
color
,
AVFrame
*
frame
)
int
color
,
AVFrame
*
frame
)
{
{
ARBCContext
*
s
=
avctx
->
priv_data
;
ARBCContext
*
s
=
avctx
->
priv_data
;
GetByteContext
*
gb
=
&
s
->
gb
;
GetByteContext
*
gb
=
&
s
->
gb
;
...
@@ -99,9 +97,7 @@ static void fill_tileX(AVCodecContext *avctx, int tile_width, int tile_height,
...
@@ -99,9 +97,7 @@ static void fill_tileX(AVCodecContext *avctx, int tile_width, int tile_height,
for
(
int
n
=
0
;
n
<
step_w
;
n
++
)
{
for
(
int
n
=
0
;
n
<
step_w
;
n
++
)
{
if
(
j
+
m
>=
avctx
->
height
||
k
+
n
>=
avctx
->
width
)
if
(
j
+
m
>=
avctx
->
height
||
k
+
n
>=
avctx
->
width
)
continue
;
continue
;
frame
->
data
[
0
][
frame
->
linesize
[
0
]
*
(
h
-
(
j
+
m
))
+
3
*
(
k
+
n
)
+
0
]
=
color
[
0
];
AV_WB24
(
&
frame
->
data
[
0
][
frame
->
linesize
[
0
]
*
(
h
-
(
j
+
m
))
+
3
*
(
k
+
n
)],
color
);
frame
->
data
[
0
][
frame
->
linesize
[
0
]
*
(
h
-
(
j
+
m
))
+
3
*
(
k
+
n
)
+
1
]
=
color
[
1
];
frame
->
data
[
0
][
frame
->
linesize
[
0
]
*
(
h
-
(
j
+
m
))
+
3
*
(
k
+
n
)
+
2
]
=
color
[
2
];
}
}
}
}
}
}
...
@@ -138,16 +134,16 @@ static int decode_frame(AVCodecContext *avctx, void *data,
...
@@ -138,16 +134,16 @@ static int decode_frame(AVCodecContext *avctx, void *data,
for
(
int
i
=
0
;
i
<
nb_segments
;
i
++
)
{
for
(
int
i
=
0
;
i
<
nb_segments
;
i
++
)
{
int
resolution_flag
;
int
resolution_flag
;
uint8_t
fill
[
3
]
;
int
fill
;
if
(
bytestream2_get_bytes_left
(
&
s
->
gb
)
<=
0
)
if
(
bytestream2_get_bytes_left
(
&
s
->
gb
)
<=
0
)
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
fill
[
0
]
=
bytestream2_get_byte
(
&
s
->
gb
)
;
fill
=
bytestream2_get_byte
(
&
s
->
gb
)
<<
16
;
bytestream2_skip
(
&
s
->
gb
,
1
);
bytestream2_skip
(
&
s
->
gb
,
1
);
fill
[
1
]
=
bytestream2_get_byte
(
&
s
->
gb
)
;
fill
|=
bytestream2_get_byte
(
&
s
->
gb
)
<<
8
;
bytestream2_skip
(
&
s
->
gb
,
1
);
bytestream2_skip
(
&
s
->
gb
,
1
);
fill
[
2
]
=
bytestream2_get_byte
(
&
s
->
gb
)
;
fill
|=
bytestream2_get_byte
(
&
s
->
gb
)
<<
0
;
bytestream2_skip
(
&
s
->
gb
,
1
);
bytestream2_skip
(
&
s
->
gb
,
1
);
resolution_flag
=
bytestream2_get_byte
(
&
s
->
gb
);
resolution_flag
=
bytestream2_get_byte
(
&
s
->
gb
);
...
...
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