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
b4231b4f
Commit
b4231b4f
authored
Aug 19, 2014
by
James Almer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc/tiff: move unpack_yuv() above the deflate functions
Signed-off-by:
James Almer
<
jamrial@gmail.com
>
parent
18e70006
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
29 deletions
+28
-29
tiff.c
libavcodec/tiff.c
+28
-29
No files found.
libavcodec/tiff.c
View file @
b4231b4f
...
@@ -283,6 +283,34 @@ static int deinvert_buffer(TiffContext *s, const uint8_t *src, int size)
...
@@ -283,6 +283,34 @@ static int deinvert_buffer(TiffContext *s, const uint8_t *src, int size)
return
0
;
return
0
;
}
}
static
void
unpack_yuv
(
TiffContext
*
s
,
AVFrame
*
p
,
const
uint8_t
*
src
,
int
lnum
)
{
int
i
,
j
,
k
;
int
w
=
(
s
->
width
-
1
)
/
s
->
subsampling
[
0
]
+
1
;
uint8_t
*
pu
=
&
p
->
data
[
1
][
lnum
/
s
->
subsampling
[
1
]
*
p
->
linesize
[
1
]];
uint8_t
*
pv
=
&
p
->
data
[
2
][
lnum
/
s
->
subsampling
[
1
]
*
p
->
linesize
[
2
]];
if
(
s
->
width
%
s
->
subsampling
[
0
]
||
s
->
height
%
s
->
subsampling
[
1
])
{
for
(
i
=
0
;
i
<
w
;
i
++
)
{
for
(
j
=
0
;
j
<
s
->
subsampling
[
1
];
j
++
)
for
(
k
=
0
;
k
<
s
->
subsampling
[
0
];
k
++
)
p
->
data
[
0
][
FFMIN
(
lnum
+
j
,
s
->
height
-
1
)
*
p
->
linesize
[
0
]
+
FFMIN
(
i
*
s
->
subsampling
[
0
]
+
k
,
s
->
width
-
1
)]
=
*
src
++
;
*
pu
++
=
*
src
++
;
*
pv
++
=
*
src
++
;
}
}
else
{
for
(
i
=
0
;
i
<
w
;
i
++
)
{
for
(
j
=
0
;
j
<
s
->
subsampling
[
1
];
j
++
)
for
(
k
=
0
;
k
<
s
->
subsampling
[
0
];
k
++
)
p
->
data
[
0
][(
lnum
+
j
)
*
p
->
linesize
[
0
]
+
i
*
s
->
subsampling
[
0
]
+
k
]
=
*
src
++
;
*
pu
++
=
*
src
++
;
*
pv
++
=
*
src
++
;
}
}
}
#if CONFIG_ZLIB
#if CONFIG_ZLIB
static
int
tiff_uncompress
(
uint8_t
*
dst
,
unsigned
long
*
len
,
const
uint8_t
*
src
,
static
int
tiff_uncompress
(
uint8_t
*
dst
,
unsigned
long
*
len
,
const
uint8_t
*
src
,
int
size
)
int
size
)
...
@@ -383,35 +411,6 @@ static int tiff_unpack_fax(TiffContext *s, uint8_t *dst, int stride,
...
@@ -383,35 +411,6 @@ static int tiff_unpack_fax(TiffContext *s, uint8_t *dst, int stride,
return
ret
;
return
ret
;
}
}
static
void
unpack_yuv
(
TiffContext
*
s
,
AVFrame
*
p
,
const
uint8_t
*
src
,
int
lnum
)
{
int
i
,
j
,
k
;
int
w
=
(
s
->
width
-
1
)
/
s
->
subsampling
[
0
]
+
1
;
uint8_t
*
pu
=
&
p
->
data
[
1
][
lnum
/
s
->
subsampling
[
1
]
*
p
->
linesize
[
1
]];
uint8_t
*
pv
=
&
p
->
data
[
2
][
lnum
/
s
->
subsampling
[
1
]
*
p
->
linesize
[
2
]];
if
(
s
->
width
%
s
->
subsampling
[
0
]
||
s
->
height
%
s
->
subsampling
[
1
])
{
for
(
i
=
0
;
i
<
w
;
i
++
)
{
for
(
j
=
0
;
j
<
s
->
subsampling
[
1
];
j
++
)
for
(
k
=
0
;
k
<
s
->
subsampling
[
0
];
k
++
)
p
->
data
[
0
][
FFMIN
(
lnum
+
j
,
s
->
height
-
1
)
*
p
->
linesize
[
0
]
+
FFMIN
(
i
*
s
->
subsampling
[
0
]
+
k
,
s
->
width
-
1
)]
=
*
src
++
;
*
pu
++
=
*
src
++
;
*
pv
++
=
*
src
++
;
}
}
else
{
for
(
i
=
0
;
i
<
w
;
i
++
)
{
for
(
j
=
0
;
j
<
s
->
subsampling
[
1
];
j
++
)
for
(
k
=
0
;
k
<
s
->
subsampling
[
0
];
k
++
)
p
->
data
[
0
][(
lnum
+
j
)
*
p
->
linesize
[
0
]
+
i
*
s
->
subsampling
[
0
]
+
k
]
=
*
src
++
;
*
pu
++
=
*
src
++
;
*
pv
++
=
*
src
++
;
}
}
}
static
int
tiff_unpack_strip
(
TiffContext
*
s
,
AVFrame
*
p
,
uint8_t
*
dst
,
int
stride
,
static
int
tiff_unpack_strip
(
TiffContext
*
s
,
AVFrame
*
p
,
uint8_t
*
dst
,
int
stride
,
const
uint8_t
*
src
,
int
size
,
int
strip_start
,
int
lines
)
const
uint8_t
*
src
,
int
size
,
int
strip_start
,
int
lines
)
{
{
...
...
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