FFmpeg
Data Structures | Macros | Functions | Variables
photocd.c File Reference
#include "libavutil/avassert.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "bytestream.h"
#include "get_bits.h"
#include "internal.h"
#include "thread.h"

Go to the source code of this file.

Data Structures

struct  PhotoCDContext
 
struct  ImageInfo
 

Macros

#define CACHED_BITSTREAM_READER   !ARCH_X86_32
 
#define OFFSET(x)   offsetof(PhotoCDContext, x)
 
#define VD   AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
 

Functions

static av_noinline void interp_lowres (PhotoCDContext *s, AVFrame *picture, int width, int height)
 
static av_noinline void interp_lines (uint8_t *ptr, int linesize, int width, int height)
 
static av_noinline void interp_pixels (uint8_t *ptr, int linesize, int width, int height)
 
static av_noinline int read_hufftable (AVCodecContext *avctx, VLC *vlc)
 
static av_noinline int decode_huff (AVCodecContext *avctx, AVFrame *frame, int target_res, int curr_res)
 
static int photocd_decode_frame (AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
 
static av_cold int photocd_decode_init (AVCodecContext *avctx)
 
static av_cold int photocd_decode_close (AVCodecContext *avctx)
 

Variables

static const ImageInfo img_info [6]
 
static const AVOption options []
 
static const AVClass photocd_class
 
const AVCodec ff_photocd_decoder
 

Detailed Description

Kodak PhotoCD (a.k.a. ImagePac) image decoder

Supports resolutions up to 3072x2048.

Definition in file photocd.c.

Macro Definition Documentation

◆ CACHED_BITSTREAM_READER

#define CACHED_BITSTREAM_READER   !ARCH_X86_32

Definition at line 32 of file photocd.c.

◆ OFFSET

#define OFFSET (   x)    offsetof(PhotoCDContext, x)

Definition at line 445 of file photocd.c.

◆ VD

Definition at line 446 of file photocd.c.

Function Documentation

◆ interp_lowres()

static av_noinline void interp_lowres ( PhotoCDContext s,
AVFrame picture,
int  width,
int  height 
)
static

Definition at line 75 of file photocd.c.

Referenced by photocd_decode_frame().

◆ interp_lines()

static av_noinline void interp_lines ( uint8_t *  ptr,
int  linesize,
int  width,
int  height 
)
static

Definition at line 143 of file photocd.c.

Referenced by photocd_decode_frame().

◆ interp_pixels()

static av_noinline void interp_pixels ( uint8_t *  ptr,
int  linesize,
int  width,
int  height 
)
static

Definition at line 172 of file photocd.c.

Referenced by photocd_decode_frame().

◆ read_hufftable()

static av_noinline int read_hufftable ( AVCodecContext avctx,
VLC vlc 
)
static

Definition at line 187 of file photocd.c.

Referenced by photocd_decode_frame().

◆ decode_huff()

static av_noinline int decode_huff ( AVCodecContext avctx,
AVFrame frame,
int  target_res,
int  curr_res 
)
static

Definition at line 224 of file photocd.c.

Referenced by photocd_decode_frame().

◆ photocd_decode_frame()

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

Definition at line 293 of file photocd.c.

◆ photocd_decode_init()

static av_cold int photocd_decode_init ( AVCodecContext avctx)
static

Definition at line 424 of file photocd.c.

◆ photocd_decode_close()

static av_cold int photocd_decode_close ( AVCodecContext avctx)
static

Definition at line 435 of file photocd.c.

Variable Documentation

◆ img_info

const ImageInfo img_info[6]
static
Initial value:
= {
{8192, 192, 128},
{47104, 384, 256},
{196608, 768, 512},
{0, 1536, 1024},
{0, 3072, 2048},
{0, 6144, 4096},
}

Definition at line 66 of file photocd.c.

Referenced by decode_huff(), interp_lowres(), and photocd_decode_frame().

◆ options

const AVOption options[]
static
Initial value:
= {
{ "lowres", "Lower the decoding resolution by a power of two",
OFFSET(lowres), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 4, VD },
{ NULL },
}

Definition at line 448 of file photocd.c.

◆ photocd_class

const AVClass photocd_class
static
Initial value:
= {
.class_name = "photocd",
.item_name = av_default_item_name,
.option = options,
}

Definition at line 454 of file photocd.c.

◆ ff_photocd_decoder

const AVCodec ff_photocd_decoder
Initial value:
= {
.name = "photocd",
.priv_data_size = sizeof(PhotoCDContext),
.priv_class = &photocd_class,
.long_name = NULL_IF_CONFIG_SMALL("Kodak Photo CD"),
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
}

Definition at line 461 of file photocd.c.

FF_CODEC_CAP_INIT_THREADSAFE
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
Definition: internal.h:41
init
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:31
photocd_decode_close
static av_cold int photocd_decode_close(AVCodecContext *avctx)
Definition: photocd.c:435
VD
#define VD
Definition: photocd.c:446
OFFSET
#define OFFSET(x)
Definition: photocd.c:445
decode
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:71
AV_CODEC_CAP_FRAME_THREADS
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
Definition: codec.h:108
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:235
lowres
static int lowres
Definition: ffplay.c:336
photocd_decode_frame
static int photocd_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: photocd.c:293
AV_CODEC_ID_PHOTOCD
@ AV_CODEC_ID_PHOTOCD
Definition: codec_id.h:303
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
photocd_class
static const AVClass photocd_class
Definition: photocd.c:454
PhotoCDContext
Definition: photocd.c:43
options
static const AVOption options[]
Definition: photocd.c:448
photocd_decode_init
static av_cold int photocd_decode_init(AVCodecContext *avctx)
Definition: photocd.c:424
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201