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
a7dbfcf6
Commit
a7dbfcf6
authored
11 years ago
by
Vittorio Giovara
Browse files
Options
Downloads
Patches
Plain Diff
sgi: K&R formatting cosmetics
parent
ca36aa9e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
libavcodec/sgi.h
+1
-1
1 addition, 1 deletion
libavcodec/sgi.h
libavcodec/sgidec.c
+2
-2
2 additions, 2 deletions
libavcodec/sgidec.c
libavcodec/sgienc.c
+11
-11
11 additions, 11 deletions
libavcodec/sgienc.c
with
14 additions
and
14 deletions
libavcodec/sgi.h
+
1
−
1
View file @
a7dbfcf6
/*
/*
* SGI image encoder
* SGI image encoder
* Xiaohui Sun <tjnksxh@hotmail.com>
* Xiaohui Sun <tjnksxh@hotmail.com>
*
*
...
...
This diff is collapsed.
Click to expand it.
libavcodec/sgidec.c
+
2
−
2
View file @
a7dbfcf6
...
@@ -94,7 +94,7 @@ static int read_rle_sgi(uint8_t *out_buf, SgiState *s)
...
@@ -94,7 +94,7 @@ static int read_rle_sgi(uint8_t *out_buf, SgiState *s)
unsigned
int
start_offset
;
unsigned
int
start_offset
;
/* size of RLE offset and length tables */
/* size of RLE offset and length tables */
if
(
len
*
2
>
bytestream2_get_bytes_left
(
&
s
->
g
))
{
if
(
len
*
2
>
bytestream2_get_bytes_left
(
&
s
->
g
))
{
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
...
@@ -120,7 +120,7 @@ static int read_rle_sgi(uint8_t *out_buf, SgiState *s)
...
@@ -120,7 +120,7 @@ static int read_rle_sgi(uint8_t *out_buf, SgiState *s)
* @param s the current image state
* @param s the current image state
* @return 0 if read success, otherwise return -1.
* @return 0 if read success, otherwise return -1.
*/
*/
static
int
read_uncompressed_sgi
(
unsigned
char
*
out_buf
,
uint8_t
*
out_end
,
static
int
read_uncompressed_sgi
(
unsigned
char
*
out_buf
,
uint8_t
*
out_end
,
SgiState
*
s
)
SgiState
*
s
)
{
{
int
x
,
y
,
z
;
int
x
,
y
,
z
;
...
...
This diff is collapsed.
Click to expand it.
libavcodec/sgienc.c
+
11
−
11
View file @
a7dbfcf6
...
@@ -101,14 +101,14 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
...
@@ -101,14 +101,14 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
memset
(
buf
,
0
,
SGI_HEADER_SIZE
);
memset
(
buf
,
0
,
SGI_HEADER_SIZE
);
buf
+=
80
;
buf
+=
80
;
/* colormap */
/* colormap */
bytestream_put_be32
(
&
buf
,
0L
);
bytestream_put_be32
(
&
buf
,
0L
);
/* The rest of the 512 byte header is unused. */
/* The rest of the 512 byte header is unused. */
buf
+=
404
;
buf
+=
404
;
offsettab
=
buf
;
offsettab
=
buf
;
if
(
avctx
->
coder_type
!=
FF_CODER_TYPE_RAW
)
{
if
(
avctx
->
coder_type
!=
FF_CODER_TYPE_RAW
)
{
/* Skip RLE offset table. */
/* Skip RLE offset table. */
buf
+=
tablesize
;
buf
+=
tablesize
;
lengthtab
=
buf
;
lengthtab
=
buf
;
...
@@ -156,7 +156,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
...
@@ -156,7 +156,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
}
}
/* total length */
/* total length */
pkt
->
size
=
buf
-
pkt
->
data
;
pkt
->
size
=
buf
-
pkt
->
data
;
pkt
->
flags
|=
AV_PKT_FLAG_KEY
;
pkt
->
flags
|=
AV_PKT_FLAG_KEY
;
*
got_packet
=
1
;
*
got_packet
=
1
;
...
@@ -170,14 +170,14 @@ static av_cold int encode_close(AVCodecContext *avctx)
...
@@ -170,14 +170,14 @@ static av_cold int encode_close(AVCodecContext *avctx)
}
}
AVCodec
ff_sgi_encoder
=
{
AVCodec
ff_sgi_encoder
=
{
.
name
=
"sgi"
,
.
name
=
"sgi"
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"SGI image"
),
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"SGI image"
),
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
id
=
AV_CODEC_ID_SGI
,
.
id
=
AV_CODEC_ID_SGI
,
.
init
=
encode_init
,
.
init
=
encode_init
,
.
encode2
=
encode_frame
,
.
encode2
=
encode_frame
,
.
close
=
encode_close
,
.
close
=
encode_close
,
.
pix_fmts
=
(
const
enum
AVPixelFormat
[]){
.
pix_fmts
=
(
const
enum
AVPixelFormat
[])
{
AV_PIX_FMT_RGB24
,
AV_PIX_FMT_RGBA
,
AV_PIX_FMT_GRAY8
,
AV_PIX_FMT_NONE
AV_PIX_FMT_RGB24
,
AV_PIX_FMT_RGBA
,
AV_PIX_FMT_GRAY8
,
AV_PIX_FMT_NONE
},
},
};
};
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