FFmpeg
Loading...
Searching...
No Matches
photocd.c File Reference

Kodak PhotoCD (a.k.a. More...

#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)
 
#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)
Value:

Definition at line 443 of file photocd.c.

◆ VD

Definition at line 444 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 422 of file photocd.c.

◆ photocd_decode_close()

static av_cold int photocd_decode_close ( AVCodecContext * avctx)
static

Definition at line 433 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 },
}
#define VD
Definition amfdec.c:787
#define NULL
Definition coverity.c:32
#define OFFSET(x)
static int lowres
Definition ffplay.c:333
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258

Definition at line 446 of file photocd.c.

◆ photocd_class

const AVClass photocd_class
static
Initial value:
= {
.class_name = "photocd",
.item_name = av_default_item_name,
.option = options,
}
const char * av_default_item_name(void *ptr)
Return the context name.
Definition log.c:241
#define LIBAVUTIL_VERSION_INT
Definition version.h:85

Definition at line 452 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"),
}
#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...
#define FF_CODEC_DECODE_CB(func)
#define CODEC_LONG_NAME(str)
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition codec.h:49
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
Definition codec.h:98
@ AV_CODEC_ID_PHOTOCD
Definition codec_id.h:300
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
static av_cold int photocd_decode_close(AVCodecContext *avctx)
Definition photocd.c:433
static int photocd_decode_frame(AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt)
Definition photocd.c:293
static const AVClass photocd_class
Definition photocd.c:452
static av_cold int photocd_decode_init(AVCodecContext *avctx)
Definition photocd.c:422

Definition at line 459 of file photocd.c.