Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
82c4abbf
Commit
82c4abbf
authored
12 years ago
by
Paul B Mahol
Browse files
Options
Downloads
Patches
Plain Diff
tiffenc: use av_pix_fmt_descriptors to set bpp_tab[]
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
e100a259
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavcodec/tiffenc.c
+4
-10
4 additions, 10 deletions
libavcodec/tiffenc.c
with
4 additions
and
10 deletions
libavcodec/tiffenc.c
+
4
−
10
View file @
82c4abbf
...
...
@@ -228,7 +228,7 @@ static int encode_frame(AVCodecContext * avctx, AVPacket *pkt,
uint32_t
*
strip_offsets
=
NULL
;
int
bytes_per_row
;
uint32_t
res
[
2
]
=
{
s
->
dpi
,
1
};
// image resolution (72/1)
uint16_t
bpp_tab
[]
=
{
8
,
8
,
8
,
8
}
;
uint16_t
bpp_tab
[
4
];
int
ret
=
-
1
;
int
is_yuv
=
0
;
uint8_t
*
yuv_line
=
NULL
;
...
...
@@ -250,18 +250,10 @@ static int encode_frame(AVCodecContext * avctx, AVPacket *pkt,
case
PIX_FMT_RGBA64LE
:
s
->
bpp
=
64
;
s
->
photometric_interpretation
=
2
;
bpp_tab
[
0
]
=
16
;
bpp_tab
[
1
]
=
16
;
bpp_tab
[
2
]
=
16
;
bpp_tab
[
3
]
=
16
;
break
;
case
PIX_FMT_RGB48LE
:
s
->
bpp
=
48
;
s
->
photometric_interpretation
=
2
;
bpp_tab
[
0
]
=
16
;
bpp_tab
[
1
]
=
16
;
bpp_tab
[
2
]
=
16
;
bpp_tab
[
3
]
=
16
;
break
;
case
PIX_FMT_RGBA
:
avctx
->
bits_per_coded_sample
=
...
...
@@ -288,7 +280,6 @@ static int encode_frame(AVCodecContext * avctx, AVPacket *pkt,
avctx
->
bits_per_coded_sample
=
s
->
bpp
=
1
;
s
->
photometric_interpretation
=
avctx
->
pix_fmt
==
PIX_FMT_MONOBLACK
;
bpp_tab
[
0
]
=
1
;
break
;
case
PIX_FMT_YUV420P
:
case
PIX_FMT_YUV422P
:
...
...
@@ -310,6 +301,9 @@ static int encode_frame(AVCodecContext * avctx, AVPacket *pkt,
}
s
->
bpp_tab_size
=
av_pix_fmt_descriptors
[
avctx
->
pix_fmt
].
nb_components
;
for
(
i
=
0
;
i
<
s
->
bpp_tab_size
;
i
++
)
bpp_tab
[
i
]
=
av_pix_fmt_descriptors
[
avctx
->
pix_fmt
].
comp
[
i
].
depth_minus1
+
1
;
if
(
s
->
compr
==
TIFF_DEFLATE
||
s
->
compr
==
TIFF_ADOBE_DEFLATE
||
s
->
compr
==
TIFF_LZW
)
//best choose for DEFLATE
s
->
rps
=
s
->
height
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment