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
f69a766d
Commit
f69a766d
authored
Dec 31, 2011
by
Carl Eugen Hoyos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix mono* pam encoding.
parent
0098e79f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
pamenc.c
libavcodec/pamenc.c
+9
-2
No files found.
libavcodec/pamenc.c
View file @
f69a766d
...
...
@@ -50,7 +50,7 @@ static int pam_encode_frame(AVCodecContext *avctx, unsigned char *outbuf,
h
=
avctx
->
height
;
w
=
avctx
->
width
;
switch
(
avctx
->
pix_fmt
)
{
case
PIX_FMT_MONO
WHITE
:
case
PIX_FMT_MONO
BLACK
:
n
=
(
w
+
7
)
>>
3
;
depth
=
1
;
maxval
=
1
;
...
...
@@ -97,6 +97,13 @@ static int pam_encode_frame(AVCodecContext *avctx, unsigned char *outbuf,
}
ptr
+=
linesize
;
}
}
else
if
(
avctx
->
pix_fmt
==
PIX_FMT_MONOBLACK
){
int
j
;
for
(
i
=
0
;
i
<
h
;
i
++
)
{
for
(
j
=
0
;
j
<
w
;
j
++
)
*
s
->
bytestream
++
=
ptr
[
j
>>
3
]
>>
(
7
-
j
&
7
)
&
1
;
ptr
+=
linesize
;
}
}
else
{
for
(
i
=
0
;
i
<
h
;
i
++
)
{
memcpy
(
s
->
bytestream
,
ptr
,
n
);
...
...
@@ -115,6 +122,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_RGB32
,
PIX_FMT_GRAY8
,
PIX_FMT_MONO
WHITE
,
PIX_FMT_NONE
},
.
pix_fmts
=
(
const
enum
PixelFormat
[]){
PIX_FMT_RGB24
,
PIX_FMT_RGB32
,
PIX_FMT_GRAY8
,
PIX_FMT_MONO
BLACK
,
PIX_FMT_NONE
},
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"PAM (Portable AnyMap) image"
),
};
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