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
298ed797
Commit
298ed797
authored
Sep 18, 2012
by
Alex Converse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tiffenc: Add support for little endian RGB48 and GRAY16
parent
8701f4f8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
3 deletions
+19
-3
tiffenc.c
libavcodec/tiffenc.c
+19
-3
No files found.
libavcodec/tiffenc.c
View file @
298ed797
...
...
@@ -214,7 +214,7 @@ static int encode_frame(AVCodecContext * avctx, AVPacket *pkt,
uint32_t
*
strip_offsets
=
NULL
;
int
bytes_per_row
;
uint32_t
res
[
2
]
=
{
72
,
1
};
// image resolution (72/1)
static
const
uint16_t
bpp_tab
[]
=
{
8
,
8
,
8
,
8
};
uint16_t
bpp_tab
[]
=
{
8
,
8
,
8
,
8
};
int
ret
;
int
is_yuv
=
0
;
uint8_t
*
yuv_line
=
NULL
;
...
...
@@ -232,7 +232,22 @@ static int encode_frame(AVCodecContext * avctx, AVPacket *pkt,
s
->
subsampling
[
0
]
=
1
;
s
->
subsampling
[
1
]
=
1
;
s
->
bpp_tab_size
=
0
;
switch
(
avctx
->
pix_fmt
)
{
case
PIX_FMT_RGB48LE
:
s
->
bpp
=
48
;
s
->
photometric_interpretation
=
2
;
s
->
bpp_tab_size
=
3
;
for
(
i
=
0
;
i
<
s
->
bpp_tab_size
;
i
++
)
{
bpp_tab
[
i
]
=
16
;
}
break
;
case
PIX_FMT_GRAY16LE
:
s
->
bpp
=
16
;
s
->
photometric_interpretation
=
1
;
s
->
bpp_tab_size
=
1
;
bpp_tab
[
0
]
=
16
;
break
;
case
PIX_FMT_RGB24
:
s
->
bpp
=
24
;
s
->
photometric_interpretation
=
2
;
...
...
@@ -272,7 +287,7 @@ static int encode_frame(AVCodecContext * avctx, AVPacket *pkt,
"This colors format is not supported
\n
"
);
return
-
1
;
}
if
(
!
is_yuv
)
if
(
!
s
->
bpp_tab_size
)
s
->
bpp_tab_size
=
(
s
->
bpp
>>
3
);
if
(
s
->
compr
==
TIFF_DEFLATE
||
s
->
compr
==
TIFF_ADOBE_DEFLATE
||
s
->
compr
==
TIFF_LZW
)
...
...
@@ -474,7 +489,8 @@ AVCodec ff_tiff_encoder = {
.
priv_data_size
=
sizeof
(
TiffEncoderContext
),
.
encode2
=
encode_frame
,
.
pix_fmts
=
(
const
enum
PixelFormat
[])
{
PIX_FMT_RGB24
,
PIX_FMT_PAL8
,
PIX_FMT_GRAY8
,
PIX_FMT_RGB24
,
PIX_FMT_RGB48LE
,
PIX_FMT_PAL8
,
PIX_FMT_GRAY8
,
PIX_FMT_GRAY16LE
,
PIX_FMT_MONOBLACK
,
PIX_FMT_MONOWHITE
,
PIX_FMT_YUV420P
,
PIX_FMT_YUV422P
,
PIX_FMT_YUV444P
,
PIX_FMT_YUV410P
,
PIX_FMT_YUV411P
,
...
...
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