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
3a3790b8
Commit
3a3790b8
authored
Dec 10, 2014
by
Carl Eugen Hoyos
Committed by
Vittorio Giovara
Dec 18, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tiff: support encoding and decoding 64bit images
parent
59f0275d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
4 deletions
+10
-4
tiff.c
libavcodec/tiff.c
+7
-2
tiffenc.c
libavcodec/tiffenc.c
+2
-1
version.h
libavcodec/version.h
+1
-1
No files found.
libavcodec/tiff.c
View file @
3a3790b8
...
@@ -273,6 +273,9 @@ static int init_image(TiffContext *s, AVFrame *frame)
...
@@ -273,6 +273,9 @@ static int init_image(TiffContext *s, AVFrame *frame)
case
483
:
case
483
:
s
->
avctx
->
pix_fmt
=
s
->
le
?
AV_PIX_FMT_RGB48LE
:
AV_PIX_FMT_RGB48BE
;
s
->
avctx
->
pix_fmt
=
s
->
le
?
AV_PIX_FMT_RGB48LE
:
AV_PIX_FMT_RGB48BE
;
break
;
break
;
case
644
:
s
->
avctx
->
pix_fmt
=
s
->
le
?
AV_PIX_FMT_RGBA64LE
:
AV_PIX_FMT_RGBA64BE
;
break
;
default:
default:
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"This format is not supported (bpp=%d, bppcount=%d)
\n
"
,
"This format is not supported (bpp=%d, bppcount=%d)
\n
"
,
...
@@ -636,13 +639,15 @@ static int decode_frame(AVCodecContext *avctx,
...
@@ -636,13 +639,15 @@ static int decode_frame(AVCodecContext *avctx,
dst
=
p
->
data
[
0
];
dst
=
p
->
data
[
0
];
soff
=
s
->
bpp
>>
3
;
soff
=
s
->
bpp
>>
3
;
ssize
=
s
->
width
*
soff
;
ssize
=
s
->
width
*
soff
;
if
(
s
->
avctx
->
pix_fmt
==
AV_PIX_FMT_RGB48LE
)
{
if
(
s
->
avctx
->
pix_fmt
==
AV_PIX_FMT_RGB48LE
||
s
->
avctx
->
pix_fmt
==
AV_PIX_FMT_RGBA64LE
)
{
for
(
i
=
0
;
i
<
s
->
height
;
i
++
)
{
for
(
i
=
0
;
i
<
s
->
height
;
i
++
)
{
for
(
j
=
soff
;
j
<
ssize
;
j
+=
2
)
for
(
j
=
soff
;
j
<
ssize
;
j
+=
2
)
AV_WL16
(
dst
+
j
,
AV_RL16
(
dst
+
j
)
+
AV_RL16
(
dst
+
j
-
soff
));
AV_WL16
(
dst
+
j
,
AV_RL16
(
dst
+
j
)
+
AV_RL16
(
dst
+
j
-
soff
));
dst
+=
stride
;
dst
+=
stride
;
}
}
}
else
if
(
s
->
avctx
->
pix_fmt
==
AV_PIX_FMT_RGB48BE
)
{
}
else
if
(
s
->
avctx
->
pix_fmt
==
AV_PIX_FMT_RGB48BE
||
s
->
avctx
->
pix_fmt
==
AV_PIX_FMT_RGBA64BE
)
{
for
(
i
=
0
;
i
<
s
->
height
;
i
++
)
{
for
(
i
=
0
;
i
<
s
->
height
;
i
++
)
{
for
(
j
=
soff
;
j
<
ssize
;
j
+=
2
)
for
(
j
=
soff
;
j
<
ssize
;
j
+=
2
)
AV_WB16
(
dst
+
j
,
AV_RB16
(
dst
+
j
)
+
AV_RB16
(
dst
+
j
-
soff
));
AV_WB16
(
dst
+
j
,
AV_RB16
(
dst
+
j
)
+
AV_RB16
(
dst
+
j
-
soff
));
...
...
libavcodec/tiffenc.c
View file @
3a3790b8
...
@@ -246,6 +246,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
...
@@ -246,6 +246,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
s
->
subsampling
[
1
]
=
1
;
s
->
subsampling
[
1
]
=
1
;
switch
(
avctx
->
pix_fmt
)
{
switch
(
avctx
->
pix_fmt
)
{
case
AV_PIX_FMT_RGBA64LE
:
case
AV_PIX_FMT_RGB48LE
:
case
AV_PIX_FMT_RGB48LE
:
case
AV_PIX_FMT_GRAY16LE
:
case
AV_PIX_FMT_GRAY16LE
:
case
AV_PIX_FMT_RGBA
:
case
AV_PIX_FMT_RGBA
:
...
@@ -535,7 +536,7 @@ AVCodec ff_tiff_encoder = {
...
@@ -535,7 +536,7 @@ AVCodec ff_tiff_encoder = {
.
encode2
=
encode_frame
,
.
encode2
=
encode_frame
,
.
pix_fmts
=
(
const
enum
AVPixelFormat
[])
{
.
pix_fmts
=
(
const
enum
AVPixelFormat
[])
{
AV_PIX_FMT_RGB24
,
AV_PIX_FMT_RGB48LE
,
AV_PIX_FMT_PAL8
,
AV_PIX_FMT_RGB24
,
AV_PIX_FMT_RGB48LE
,
AV_PIX_FMT_PAL8
,
AV_PIX_FMT_RGBA
,
AV_PIX_FMT_RGBA
,
AV_PIX_FMT_RGBA64LE
,
AV_PIX_FMT_GRAY8
,
AV_PIX_FMT_GRAY16LE
,
AV_PIX_FMT_GRAY8
,
AV_PIX_FMT_GRAY16LE
,
AV_PIX_FMT_MONOBLACK
,
AV_PIX_FMT_MONOWHITE
,
AV_PIX_FMT_MONOBLACK
,
AV_PIX_FMT_MONOWHITE
,
AV_PIX_FMT_YUV420P
,
AV_PIX_FMT_YUV422P
,
AV_PIX_FMT_YUV444P
,
AV_PIX_FMT_YUV420P
,
AV_PIX_FMT_YUV422P
,
AV_PIX_FMT_YUV444P
,
...
...
libavcodec/version.h
View file @
3a3790b8
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
#define LIBAVCODEC_VERSION_MAJOR 56
#define LIBAVCODEC_VERSION_MAJOR 56
#define LIBAVCODEC_VERSION_MINOR 6
#define LIBAVCODEC_VERSION_MINOR 6
#define LIBAVCODEC_VERSION_MICRO
0
#define LIBAVCODEC_VERSION_MICRO
1
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
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