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
f3683349
Commit
f3683349
authored
Aug 31, 2012
by
Carl Eugen Hoyos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Write TIFF Tag ExtraSamples when encoding pix_fmts that contain transparency information.
parent
5eb532a9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
tiff.h
libavcodec/tiff.h
+1
-0
tiffenc.c
libavcodec/tiffenc.c
+5
-1
No files found.
libavcodec/tiff.h
View file @
f3683349
...
...
@@ -69,6 +69,7 @@ enum TiffTags{
TIFF_TILE_LENGTH
=
0x143
,
TIFF_TILE_OFFSETS
=
0x144
,
TIFF_TILE_BYTE_COUNTS
=
0x145
,
TIFF_EXTRASAMPLES
=
0x152
,
TIFF_YCBCR_COEFFICIENTS
=
0x211
,
TIFF_YCBCR_SUBSAMPLING
=
0x212
,
TIFF_YCBCR_POSITIONING
=
0x213
,
...
...
libavcodec/tiffenc.c
View file @
f3683349
...
...
@@ -248,7 +248,7 @@ static int encode_frame(AVCodecContext * avctx, AVPacket *pkt,
uint32_t
res
[
2
]
=
{
s
->
dpi
,
1
};
// image resolution (72/1)
uint16_t
bpp_tab
[
4
];
int
ret
=
-
1
;
int
is_yuv
=
0
;
int
is_yuv
=
0
,
alpha
=
0
;
int
shift_h
,
shift_v
;
*
p
=
*
pict
;
...
...
@@ -264,6 +264,7 @@ static int encode_frame(AVCodecContext * avctx, AVPacket *pkt,
switch
(
avctx
->
pix_fmt
)
{
case
PIX_FMT_RGBA64LE
:
case
PIX_FMT_RGBA
:
alpha
=
1
;
case
PIX_FMT_RGB48LE
:
case
PIX_FMT_RGB24
:
s
->
photometric_interpretation
=
2
;
...
...
@@ -271,6 +272,7 @@ static int encode_frame(AVCodecContext * avctx, AVPacket *pkt,
case
PIX_FMT_GRAY8
:
avctx
->
bits_per_coded_sample
=
0x28
;
case
PIX_FMT_GRAY8A
:
alpha
=
avctx
->
pix_fmt
==
PIX_FMT_GRAY8A
;
case
PIX_FMT_GRAY16LE
:
case
PIX_FMT_MONOBLACK
:
s
->
photometric_interpretation
=
1
;
...
...
@@ -451,6 +453,8 @@ static int encode_frame(AVCodecContext * avctx, AVPacket *pkt,
}
add_entry
(
s
,
TIFF_PAL
,
TIFF_SHORT
,
256
*
3
,
pal
);
}
if
(
alpha
)
add_entry1
(
s
,
TIFF_EXTRASAMPLES
,
TIFF_SHORT
,
2
);
if
(
is_yuv
){
/** according to CCIR Recommendation 601.1 */
uint32_t
refbw
[
12
]
=
{
15
,
1
,
235
,
1
,
128
,
1
,
240
,
1
,
128
,
1
,
240
,
1
};
...
...
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