Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
f7e30cc1
Commit
f7e30cc1
authored
13 years ago
by
Aneesh Dogra
Committed by
Anton Khirnov
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
bfi: K&R cosmetics
Signed-off-by:
Anton Khirnov
<
anton@khirnov.net
>
parent
87d98748
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavcodec/bfi.c
+12
-11
12 additions, 11 deletions
libavcodec/bfi.c
with
12 additions
and
11 deletions
libavcodec/bfi.c
+
12
−
11
View file @
f7e30cc1
...
...
@@ -36,7 +36,7 @@ typedef struct BFIContext {
uint8_t
*
dst
;
}
BFIContext
;
static
av_cold
int
bfi_decode_init
(
AVCodecContext
*
avctx
)
static
av_cold
int
bfi_decode_init
(
AVCodecContext
*
avctx
)
{
BFIContext
*
bfi
=
avctx
->
priv_data
;
avctx
->
pix_fmt
=
PIX_FMT_PAL8
;
...
...
@@ -44,7 +44,7 @@ static av_cold int bfi_decode_init(AVCodecContext * avctx)
return
0
;
}
static
int
bfi_decode_frame
(
AVCodecContext
*
avctx
,
void
*
data
,
static
int
bfi_decode_frame
(
AVCodecContext
*
avctx
,
void
*
data
,
int
*
data_size
,
AVPacket
*
avpkt
)
{
const
uint8_t
*
buf
=
avpkt
->
data
,
*
buf_end
=
avpkt
->
data
+
avpkt
->
size
;
...
...
@@ -71,11 +71,11 @@ static int bfi_decode_frame(AVCodecContext * avctx, void *data,
bfi
->
frame
.
pict_type
=
AV_PICTURE_TYPE_I
;
bfi
->
frame
.
key_frame
=
1
;
/* Setting the palette */
if
(
avctx
->
extradata_size
>
768
)
{
if
(
avctx
->
extradata_size
>
768
)
{
av_log
(
NULL
,
AV_LOG_ERROR
,
"Palette is too large.
\n
"
);
return
-
1
;
}
pal
=
(
uint32_t
*
)
bfi
->
frame
.
data
[
1
];
pal
=
(
uint32_t
*
)
bfi
->
frame
.
data
[
1
];
for
(
i
=
0
;
i
<
avctx
->
extradata_size
/
3
;
i
++
)
{
int
shift
=
16
;
*
pal
=
0
;
...
...
@@ -91,16 +91,17 @@ static int bfi_decode_frame(AVCodecContext * avctx, void *data,
bfi
->
frame
.
key_frame
=
0
;
}
buf
+=
4
;
//Unpacked size, not required.
buf
+=
4
;
//
Unpacked size, not required.
while
(
dst
!=
frame_end
)
{
static
const
uint8_t
lentab
[
4
]
=
{
0
,
2
,
0
,
1
};
unsigned
int
byte
=
*
buf
++
,
av_uninit
(
offset
);
unsigned
int
code
=
byte
>>
6
;
static
const
uint8_t
lentab
[
4
]
=
{
0
,
2
,
0
,
1
};
unsigned
int
byte
=
*
buf
++
,
av_uninit
(
offset
);
unsigned
int
code
=
byte
>>
6
;
unsigned
int
length
=
byte
&
~
0xC0
;
if
(
buf
>=
buf_end
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Input resolution larger than actual frame.
\n
"
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Input resolution larger than actual frame.
\n
"
);
return
-
1
;
}
...
...
@@ -120,7 +121,7 @@ static int bfi_decode_frame(AVCodecContext * avctx, void *data,
}
/* Do boundary check */
if
(
dst
+
(
length
<<
lentab
[
code
])
>
frame_end
)
if
(
dst
+
(
length
<<
lentab
[
code
])
>
frame_end
)
break
;
switch
(
code
)
{
...
...
@@ -167,7 +168,7 @@ static int bfi_decode_frame(AVCodecContext * avctx, void *data,
dst
+=
bfi
->
frame
.
linesize
[
0
];
}
*
data_size
=
sizeof
(
AVFrame
);
*
(
AVFrame
*
)
data
=
bfi
->
frame
;
*
(
AVFrame
*
)
data
=
bfi
->
frame
;
return
buf_size
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment