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
788e116c
Commit
788e116c
authored
Dec 06, 2018
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/dpx: improve decoding of 10 bit gray images
parent
f628970e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
3 deletions
+25
-3
dpx.c
libavcodec/dpx.c
+25
-3
No files found.
libavcodec/dpx.c
View file @
788e116c
...
...
@@ -51,6 +51,24 @@ static unsigned int read32(const uint8_t **ptr, int is_big)
return
temp
;
}
static
uint16_t
read10in32_gray
(
const
uint8_t
**
ptr
,
uint32_t
*
lbuf
,
int
*
n_datum
,
int
is_big
,
int
shift
)
{
uint16_t
temp
;
if
(
*
n_datum
)
(
*
n_datum
)
--
;
else
{
*
lbuf
=
read32
(
ptr
,
is_big
);
*
n_datum
=
2
;
}
temp
=
*
lbuf
>>
shift
&
0x3FF
;
*
lbuf
=
*
lbuf
>>
10
;
return
temp
;
}
static
uint16_t
read10in32
(
const
uint8_t
**
ptr
,
uint32_t
*
lbuf
,
int
*
n_datum
,
int
is_big
,
int
shift
)
{
...
...
@@ -385,13 +403,17 @@ static int decode_frame(AVCodecContext *avctx,
(
uint16_t
*
)
ptr
[
1
],
(
uint16_t
*
)
ptr
[
2
],
(
uint16_t
*
)
ptr
[
3
]};
int
shift
=
packing
==
1
?
22
:
2
0
;
int
shift
=
elements
>
1
?
packing
==
1
?
22
:
20
:
packing
==
1
?
2
:
0
;
for
(
y
=
0
;
y
<
avctx
->
width
;
y
++
)
{
if
(
elements
>=
3
)
*
dst
[
2
]
++
=
read10in32
(
&
buf
,
&
rgbBuffer
,
&
n_datum
,
endian
,
shift
);
*
dst
[
0
]
++
=
read10in32
(
&
buf
,
&
rgbBuffer
,
&
n_datum
,
endian
,
shift
);
if
(
elements
==
1
)
*
dst
[
0
]
++
=
read10in32_gray
(
&
buf
,
&
rgbBuffer
,
&
n_datum
,
endian
,
shift
);
else
*
dst
[
0
]
++
=
read10in32
(
&
buf
,
&
rgbBuffer
,
&
n_datum
,
endian
,
shift
);
if
(
elements
>=
2
)
*
dst
[
1
]
++
=
read10in32
(
&
buf
,
&
rgbBuffer
,
&
n_datum
,
endian
,
shift
);
...
...
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