FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
tiff.c File Reference

TIFF image decoder. More...

#include "config.h"
#include "libavutil/attributes.h"
#include "libavutil/avstring.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/imgutils.h"
#include "avcodec.h"
#include "bytestream.h"
#include "faxcompr.h"
#include "internal.h"
#include "lzw.h"
#include "mathops.h"
#include "tiff.h"
#include "tiff_data.h"
#include "thread.h"

Go to the source code of this file.

Data Structures

struct  TiffContext
 

Macros

#define RET_GEOKEY(TYPE, array, element)
 
#define RET_GEOKEY_VAL(TYPE, array)
 
#define ADD_METADATA(count, name, sep)
 

Functions

static void free_geotags (TiffContext *const s)
 
static const char * get_geokey_name (int key)
 
static int get_geokey_type (int key)
 
static int cmp_id_key (const void *id, const void *k)
 
static const char * search_keyval (const TiffGeoTagKeyName *keys, int n, int id)
 
static char * get_geokey_val (int key, int val)
 
static char * doubles2str (double *dp, int count, const char *sep)
 
static int add_metadata (int count, int type, const char *name, const char *sep, TiffContext *s, AVFrame *frame)
 
static void av_always_inline horizontal_fill (unsigned int bpp, uint8_t *dst, int usePtr, const uint8_t *src, uint8_t c, int width, int offset)
 
static int deinvert_buffer (TiffContext *s, const uint8_t *src, int size)
 
static int tiff_unpack_fax (TiffContext *s, uint8_t *dst, int stride, const uint8_t *src, int size, int width, int lines)
 
static int tiff_unpack_strip (TiffContext *s, uint8_t *dst, int stride, const uint8_t *src, int size, int lines)
 
static int init_image (TiffContext *s, ThreadFrame *frame)
 
static int tiff_decode_tag (TiffContext *s, AVFrame *frame)
 
static int decode_frame (AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
 
static av_cold int tiff_init (AVCodecContext *avctx)
 
static av_cold int tiff_end (AVCodecContext *avctx)
 

Variables

AVCodec ff_tiff_decoder
 

Detailed Description

TIFF image decoder.

Author
Konstantin Shishkov

Definition in file tiff.c.

Macro Definition Documentation

#define RET_GEOKEY (   TYPE,
  array,
  element 
)
Value:
if (key >= TIFF_##TYPE##_KEY_ID_OFFSET &&\
key - TIFF_##TYPE##_KEY_ID_OFFSET < FF_ARRAY_ELEMS(ff_tiff_##array##_name_type_map))\
return ff_tiff_##array##_name_type_map[key - TIFF_##TYPE##_KEY_ID_OFFSET].element;

Definition at line 84 of file tiff.c.

Referenced by get_geokey_name(), and get_geokey_type().

#define RET_GEOKEY_VAL (   TYPE,
  array 
)
Value:
if (val >= TIFF_##TYPE##_OFFSET &&\
val - TIFF_##TYPE##_OFFSET < FF_ARRAY_ELEMS(ff_tiff_##array##_codes))\
return av_strdup(ff_tiff_##array##_codes[val - TIFF_##TYPE##_OFFSET]);

Referenced by get_geokey_val().

#define ADD_METADATA (   count,
  name,
  sep 
)
Value:
if ((ret = add_metadata(count, type, name, sep, s, frame)) < 0) {\
av_log(s->avctx, AV_LOG_ERROR, "Error allocating temporary buffer\n");\
goto end;\
}

Referenced by tiff_decode_tag().

Function Documentation

static void free_geotags ( TiffContext *const  s)
static

Definition at line 74 of file tiff.c.

Referenced by decode_frame(), and tiff_end().

static const char* get_geokey_name ( int  key)
static

Definition at line 89 of file tiff.c.

Referenced by decode_frame().

static int get_geokey_type ( int  key)
static

Definition at line 99 of file tiff.c.

Referenced by decode_frame().

static int cmp_id_key ( const void id,
const void k 
)
static

Definition at line 109 of file tiff.c.

Referenced by search_keyval().

static const char* search_keyval ( const TiffGeoTagKeyName keys,
int  n,
int  id 
)
static

Definition at line 114 of file tiff.c.

Referenced by get_geokey_val().

static char* get_geokey_val ( int  key,
int  val 
)
static

Definition at line 123 of file tiff.c.

Referenced by tiff_decode_tag().

static char* doubles2str ( double *  dp,
int  count,
const char *  sep 
)
static

Definition at line 191 of file tiff.c.

Referenced by tiff_decode_tag().

static int add_metadata ( int  count,
int  type,
const char *  name,
const char *  sep,
TiffContext s,
AVFrame frame 
)
static

Definition at line 217 of file tiff.c.

static void av_always_inline horizontal_fill ( unsigned int  bpp,
uint8_t dst,
int  usePtr,
const uint8_t src,
uint8_t  c,
int  width,
int  offset 
)
static

Definition at line 228 of file tiff.c.

Referenced by tiff_unpack_fax(), and tiff_unpack_strip().

static int deinvert_buffer ( TiffContext s,
const uint8_t src,
int  size 
)
static

Definition at line 268 of file tiff.c.

Referenced by tiff_unpack_strip().

static int tiff_unpack_fax ( TiffContext s,
uint8_t dst,
int  stride,
const uint8_t src,
int  size,
int  width,
int  lines 
)
static

Definition at line 345 of file tiff.c.

Referenced by tiff_unpack_strip().

static int tiff_unpack_strip ( TiffContext s,
uint8_t dst,
int  stride,
const uint8_t src,
int  size,
int  lines 
)
static

Definition at line 381 of file tiff.c.

Referenced by decode_frame().

static int init_image ( TiffContext s,
ThreadFrame frame 
)
static

Definition at line 496 of file tiff.c.

Referenced by decode_frame().

static int tiff_decode_tag ( TiffContext s,
AVFrame frame 
)
static

Definition at line 568 of file tiff.c.

Referenced by decode_frame().

static int decode_frame ( AVCodecContext avctx,
void data,
int *  got_frame,
AVPacket avpkt 
)
static

Definition at line 925 of file tiff.c.

static av_cold int tiff_init ( AVCodecContext avctx)
static

Definition at line 1097 of file tiff.c.

static av_cold int tiff_end ( AVCodecContext avctx)
static

Definition at line 1110 of file tiff.c.

Variable Documentation

AVCodec ff_tiff_decoder
Initial value:
= {
.name = "tiff",
.long_name = NULL_IF_CONFIG_SMALL("TIFF image"),
.priv_data_size = sizeof(TiffContext),
}

Definition at line 1121 of file tiff.c.