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
9511a089
Commit
9511a089
authored
Jun 04, 2016
by
Martin Vignali
Committed by
Paul B Mahol
Jun 06, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/exr: indent b44 uncompress function
parent
bc1f3dfa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
26 deletions
+26
-26
exr.c
libavcodec/exr.c
+26
-26
No files found.
libavcodec/exr.c
View file @
9511a089
...
...
@@ -945,37 +945,37 @@ static int b44_uncompress(EXRContext *s, const uint8_t *src, int compressed_size
for
(
iY
=
0
;
iY
<
nbB44BlockH
;
iY
++
)
{
for
(
iX
=
0
;
iX
<
nbB44BlockW
;
iX
++
)
{
/* For each B44 block */
if
(
s
->
channels
[
c
].
pixel_type
==
EXR_HALF
)
{
/* B44 only compress half float data */
if
(
stayToUncompress
<
3
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"Not enough data for B44A block: %d"
,
stayToUncompress
);
return
AVERROR_INVALIDDATA
;
}
if
(
src
[
compressed_size
-
stayToUncompress
+
2
]
==
0xfc
)
{
/* B44A block */
unpack_3
(
sr
,
tmpBuffer
);
sr
+=
3
;
stayToUncompress
-=
3
;
}
else
{
/* B44 Block */
if
(
stayToUncompress
<
14
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"Not enough data for B44 block: %d"
,
stayToUncompress
);
if
(
stayToUncompress
<
3
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"Not enough data for B44A block: %d"
,
stayToUncompress
);
return
AVERROR_INVALIDDATA
;
}
unpack_14
(
sr
,
tmpBuffer
);
sr
+=
14
;
stayToUncompress
-=
14
;
}
/* copy data to uncompress buffer (B44 block can exceed target resolution)*/
indexHgX
=
iX
*
4
;
indexHgY
=
iY
*
4
;
if
(
src
[
compressed_size
-
stayToUncompress
+
2
]
==
0xfc
)
{
/* B44A block */
unpack_3
(
sr
,
tmpBuffer
);
sr
+=
3
;
stayToUncompress
-=
3
;
}
else
{
/* B44 Block */
if
(
stayToUncompress
<
14
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"Not enough data for B44 block: %d"
,
stayToUncompress
);
return
AVERROR_INVALIDDATA
;
}
unpack_14
(
sr
,
tmpBuffer
);
sr
+=
14
;
stayToUncompress
-=
14
;
}
/* copy data to uncompress buffer (B44 block can exceed target resolution)*/
indexHgX
=
iX
*
4
;
indexHgY
=
iY
*
4
;
for
(
y
=
indexHgY
;
y
<
FFMIN
(
indexHgY
+
4
,
td
->
ysize
);
y
++
)
{
for
(
x
=
indexHgX
;
x
<
FFMIN
(
indexHgX
+
4
,
td
->
xsize
);
x
++
)
{
indexOut
=
target_channel_offset
*
td
->
xsize
+
y
*
td
->
channel_line_size
+
2
*
x
;
indexTmp
=
(
y
-
indexHgY
)
*
4
+
(
x
-
indexHgX
);
td
->
uncompressed_data
[
indexOut
]
=
tmpBuffer
[
indexTmp
]
&
0xff
;
td
->
uncompressed_data
[
indexOut
+
1
]
=
tmpBuffer
[
indexTmp
]
>>
8
;
for
(
y
=
indexHgY
;
y
<
FFMIN
(
indexHgY
+
4
,
td
->
ysize
);
y
++
)
{
for
(
x
=
indexHgX
;
x
<
FFMIN
(
indexHgX
+
4
,
td
->
xsize
);
x
++
)
{
indexOut
=
target_channel_offset
*
td
->
xsize
+
y
*
td
->
channel_line_size
+
2
*
x
;
indexTmp
=
(
y
-
indexHgY
)
*
4
+
(
x
-
indexHgX
);
td
->
uncompressed_data
[
indexOut
]
=
tmpBuffer
[
indexTmp
]
&
0xff
;
td
->
uncompressed_data
[
indexOut
+
1
]
=
tmpBuffer
[
indexTmp
]
>>
8
;
}
}
}
}
else
{
/* Float or UINT 32 channel */
for
(
y
=
indexHgY
;
y
<
FFMIN
(
indexHgY
+
4
,
td
->
ysize
);
y
++
)
{
for
(
x
=
indexHgX
;
x
<
FFMIN
(
indexHgX
+
4
,
td
->
xsize
);
x
++
)
{
...
...
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