FFmpeg
Data Structures | Macros | Functions | Variables
photocd.c File Reference
#include "libavutil/intreadwrite.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "bytestream.h"
#include "codec_internal.h"
#include "decode.h"
#include "get_bits.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, AVFrame *p, 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 FFCodec 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 446 of file photocd.c.

◆ VD

Definition at line 447 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,
AVFrame p,
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 425 of file photocd.c.

◆ photocd_decode_close()

static av_cold int photocd_decode_close ( AVCodecContext avctx)
static

Definition at line 436 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 449 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 455 of file photocd.c.

◆ ff_photocd_decoder

const FFCodec ff_photocd_decoder
Initial value:
= {
.p.name = "photocd",
.p.type = AVMEDIA_TYPE_VIDEO,
.priv_data_size = sizeof(PhotoCDContext),
.p.priv_class = &photocd_class,
CODEC_LONG_NAME("Kodak Photo CD"),
}

Definition at line 462 of file photocd.c.

photocd_decode_close
static av_cold int photocd_decode_close(AVCodecContext *avctx)
Definition: photocd.c:436
photocd_decode_frame
static int photocd_decode_frame(AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt)
Definition: photocd.c:293
VD
#define VD
Definition: photocd.c:447
OFFSET
#define OFFSET(x)
Definition: photocd.c:446
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:287
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:272
AV_CODEC_CAP_FRAME_THREADS
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
Definition: codec.h:110
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:237
lowres
static int lowres
Definition: ffplay.c:333
AV_CODEC_ID_PHOTOCD
@ AV_CODEC_ID_PHOTOCD
Definition: codec_id.h:305
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
photocd_class
static const AVClass photocd_class
Definition: photocd.c:455
FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM
#define FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM
The decoder extracts and fills its parameters even if the frame is skipped due to the skip_frame sett...
Definition: codec_internal.h:54
PhotoCDContext
Definition: photocd.c:43
options
static const AVOption options[]
Definition: photocd.c:449
photocd_decode_init
static av_cold int photocd_decode_init(AVCodecContext *avctx)
Definition: photocd.c:425
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:235
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201