Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
7c10d3ca
Commit
7c10d3ca
authored
Jan 13, 2012
by
Carl Eugen Hoyos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify 32bit RGB pam encoding.
Reviewed-by: Paul B Mahol
parent
4cef928e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
16 deletions
+4
-16
pamenc.c
libavcodec/pamenc.c
+3
-15
version.h
libavcodec/version.h
+1
-1
No files found.
libavcodec/pamenc.c
View file @
7c10d3ca
...
...
@@ -80,7 +80,7 @@ static int pam_encode_frame(AVCodecContext *avctx, unsigned char *outbuf,
maxval
=
255
;
tuple_type
=
"RGB"
;
break
;
case
PIX_FMT_RGB
32
:
case
PIX_FMT_RGB
A
:
n
=
w
*
4
;
depth
=
4
;
maxval
=
255
;
...
...
@@ -103,19 +103,7 @@ static int pam_encode_frame(AVCodecContext *avctx, unsigned char *outbuf,
ptr
=
p
->
data
[
0
];
linesize
=
p
->
linesize
[
0
];
if
(
avctx
->
pix_fmt
==
PIX_FMT_RGB32
)
{
int
j
;
unsigned
int
v
;
for
(
i
=
0
;
i
<
h
;
i
++
)
{
for
(
j
=
0
;
j
<
w
;
j
++
)
{
v
=
((
uint32_t
*
)
ptr
)[
j
];
bytestream_put_be24
(
&
s
->
bytestream
,
v
);
*
s
->
bytestream
++
=
v
>>
24
;
}
ptr
+=
linesize
;
}
}
else
if
(
avctx
->
pix_fmt
==
PIX_FMT_MONOBLACK
){
if
(
avctx
->
pix_fmt
==
PIX_FMT_MONOBLACK
){
int
j
;
for
(
i
=
0
;
i
<
h
;
i
++
)
{
for
(
j
=
0
;
j
<
w
;
j
++
)
...
...
@@ -140,6 +128,6 @@ AVCodec ff_pam_encoder = {
.
priv_data_size
=
sizeof
(
PNMContext
),
.
init
=
ff_pnm_init
,
.
encode
=
pam_encode_frame
,
.
pix_fmts
=
(
const
enum
PixelFormat
[]){
PIX_FMT_RGB24
,
PIX_FMT_RGB
32
,
PIX_FMT_RGB48BE
,
PIX_FMT_GRAY8
,
PIX_FMT_GRAY8A
,
PIX_FMT_GRAY16BE
,
PIX_FMT_MONOBLACK
,
PIX_FMT_NONE
},
.
pix_fmts
=
(
const
enum
PixelFormat
[]){
PIX_FMT_RGB24
,
PIX_FMT_RGB
A
,
PIX_FMT_RGB48BE
,
PIX_FMT_GRAY8
,
PIX_FMT_GRAY8A
,
PIX_FMT_GRAY16BE
,
PIX_FMT_MONOBLACK
,
PIX_FMT_NONE
},
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"PAM (Portable AnyMap) image"
),
};
libavcodec/version.h
View file @
7c10d3ca
...
...
@@ -22,7 +22,7 @@
#define LIBAVCODEC_VERSION_MAJOR 53
#define LIBAVCODEC_VERSION_MINOR 55
#define LIBAVCODEC_VERSION_MICRO 10
0
#define LIBAVCODEC_VERSION_MICRO 10
1
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
...
...
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