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
b614c147
Commit
b614c147
authored
Jan 19, 2012
by
Carl Eugen Hoyos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify 32bit pam decoding.
Reviewed-by: Paul B Mahol
parent
34aadeaa
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
20 deletions
+7
-20
pnm.c
libavcodec/pnm.c
+1
-1
pnmdec.c
libavcodec/pnmdec.c
+5
-18
version.h
libavcodec/version.h
+1
-1
No files found.
libavcodec/pnm.c
View file @
b614c147
...
...
@@ -129,7 +129,7 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s)
}
}
else
if
(
depth
==
4
)
{
if
(
maxval
<
256
)
{
avctx
->
pix_fmt
=
PIX_FMT_RGB
32
;
avctx
->
pix_fmt
=
PIX_FMT_RGB
A
;
}
else
{
avctx
->
pix_fmt
=
PIX_FMT_RGBA64BE
;
}
...
...
libavcodec/pnmdec.c
View file @
b614c147
...
...
@@ -67,6 +67,11 @@ static int pnm_decode_frame(AVCodecContext *avctx, void *data,
components
=
3
;
sample_len
=
16
;
goto
do_read
;
case
PIX_FMT_RGBA
:
n
=
avctx
->
width
*
4
;
components
=
4
;
sample_len
=
8
;
goto
do_read
;
case
PIX_FMT_RGB24
:
n
=
avctx
->
width
*
3
;
components
=
3
;
...
...
@@ -177,24 +182,6 @@ static int pnm_decode_frame(AVCodecContext *avctx, void *data,
}
}
break
;
case
PIX_FMT_RGB32
:
ptr
=
p
->
data
[
0
];
linesize
=
p
->
linesize
[
0
];
if
(
s
->
bytestream
+
avctx
->
width
*
avctx
->
height
*
4
>
s
->
bytestream_end
)
return
-
1
;
for
(
i
=
0
;
i
<
avctx
->
height
;
i
++
)
{
int
j
,
r
,
g
,
b
,
a
;
for
(
j
=
0
;
j
<
avctx
->
width
;
j
++
)
{
r
=
*
s
->
bytestream
++
;
g
=
*
s
->
bytestream
++
;
b
=
*
s
->
bytestream
++
;
a
=
*
s
->
bytestream
++
;
((
uint32_t
*
)
ptr
)[
j
]
=
(
a
<<
24
)
|
(
r
<<
16
)
|
(
g
<<
8
)
|
b
;
}
ptr
+=
linesize
;
}
break
;
}
*
picture
=
*
(
AVFrame
*
)
&
s
->
picture
;
*
data_size
=
sizeof
(
AVPicture
);
...
...
libavcodec/version.h
View file @
b614c147
...
...
@@ -22,7 +22,7 @@
#define LIBAVCODEC_VERSION_MAJOR 53
#define LIBAVCODEC_VERSION_MINOR 57
#define LIBAVCODEC_VERSION_MICRO 10
1
#define LIBAVCODEC_VERSION_MICRO 10
2
#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