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
658e626c
Commit
658e626c
authored
Jan 10, 2017
by
Martin Vignali
Committed by
Carl Eugen Hoyos
Jan 10, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libavcodec/psd : add support for psd bitmap mode
Fixes ticket #6044 Based on patch by Carl Eugen Hoyos
parent
4313ed51
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
psd.c
libavcodec/psd.c
+8
-3
No files found.
libavcodec/psd.c
View file @
658e626c
...
...
@@ -316,9 +316,12 @@ static int decode_frame(AVCodecContext *avctx, void *data,
s
->
pixel_size
=
s
->
channel_depth
>>
3
;
/* in byte */
s
->
line_size
=
s
->
width
*
s
->
pixel_size
;
s
->
uncompressed_size
=
s
->
line_size
*
s
->
height
*
s
->
channel_count
;
switch
(
s
->
color_mode
)
{
case
PSD_BITMAP
:
s
->
line_size
=
s
->
width
+
7
>>
3
;
avctx
->
pix_fmt
=
AV_PIX_FMT_MONOWHITE
;
break
;
case
PSD_INDEXED
:
if
(
s
->
channel_depth
!=
8
||
s
->
channel_count
!=
1
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
...
...
@@ -383,6 +386,8 @@ static int decode_frame(AVCodecContext *avctx, void *data,
return
AVERROR_PATCHWELCOME
;
}
s
->
uncompressed_size
=
s
->
line_size
*
s
->
height
*
s
->
channel_count
;
if
((
ret
=
ff_get_buffer
(
avctx
,
picture
,
0
))
<
0
)
return
ret
;
...
...
@@ -430,9 +435,9 @@ static int decode_frame(AVCodecContext *avctx, void *data,
plane_number
=
eq_channel
[
c
];
ptr
=
picture
->
data
[
plane_number
];
/* get the right plane */
for
(
y
=
0
;
y
<
s
->
height
;
y
++
)
{
memcpy
(
ptr
,
ptr_data
,
s
->
width
*
s
->
pixel
_size
);
memcpy
(
ptr
,
ptr_data
,
s
->
line
_size
);
ptr
+=
picture
->
linesize
[
plane_number
];
ptr_data
+=
s
->
width
*
s
->
pixel
_size
;
ptr_data
+=
s
->
line
_size
;
}
}
}
...
...
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