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
a94c769d
Commit
a94c769d
authored
Nov 23, 2011
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tiffenc: add a private option for selecting compression algorithm
parent
50efd3ca
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
1 deletion
+25
-1
tiffenc.c
libavcodec/tiffenc.c
+25
-1
No files found.
libavcodec/tiffenc.c
View file @
a94c769d
...
...
@@ -25,6 +25,9 @@
* @author Bartlomiej Wolowiec
*/
#include "libavutil/log.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#if CONFIG_ZLIB
#include <zlib.h>
...
...
@@ -43,6 +46,7 @@ static const uint8_t type_sizes2[6] = {
};
typedef
struct
TiffEncoderContext
{
AVClass
*
class
;
///< for private options
AVCodecContext
*
avctx
;
AVFrame
picture
;
...
...
@@ -227,7 +231,6 @@ static int encode_frame(AVCodecContext * avctx, unsigned char *buf,
p
->
key_frame
=
1
;
avctx
->
coded_frame
=
&
s
->
picture
;
s
->
compr
=
TIFF_PACKBITS
;
if
(
avctx
->
compression_level
==
0
)
{
s
->
compr
=
TIFF_RAW
;
}
else
if
(
avctx
->
compression_level
==
2
)
{
...
...
@@ -444,6 +447,26 @@ fail:
return
ret
;
}
#define OFFSET(x) offsetof(TiffEncoderContext, x)
#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
static
const
AVOption
options
[]
=
{
{
"compression_algo"
,
NULL
,
OFFSET
(
compr
),
AV_OPT_TYPE_INT
,
{
TIFF_PACKBITS
},
TIFF_RAW
,
TIFF_DEFLATE
,
VE
,
"compression_algo"
},
{
"packbits"
,
NULL
,
0
,
AV_OPT_TYPE_CONST
,
{
TIFF_PACKBITS
},
0
,
0
,
VE
,
"compression_algo"
},
{
"raw"
,
NULL
,
0
,
AV_OPT_TYPE_CONST
,
{
TIFF_RAW
},
0
,
0
,
VE
,
"compression_algo"
},
{
"lzw"
,
NULL
,
0
,
AV_OPT_TYPE_CONST
,
{
TIFF_LZW
},
0
,
0
,
VE
,
"compression_algo"
},
#if CONFIG_ZLIB
{
"deflate"
,
NULL
,
0
,
AV_OPT_TYPE_CONST
,
{
TIFF_DEFLATE
},
0
,
0
,
VE
,
"compression_algo"
},
#endif
{
NULL
},
};
static
const
AVClass
tiffenc_class
=
{
.
class_name
=
"TIFF encoder"
,
.
item_name
=
av_default_item_name
,
.
option
=
options
,
.
version
=
LIBAVUTIL_VERSION_INT
,
};
AVCodec
ff_tiff_encoder
=
{
.
name
=
"tiff"
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
...
...
@@ -458,4 +481,5 @@ AVCodec ff_tiff_encoder = {
PIX_FMT_YUV411P
,
PIX_FMT_NONE
},
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"TIFF image"
),
.
priv_class
=
&
tiffenc_class
,
};
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