FFmpeg
Data Structures | Macros | Functions | Variables
pixlet.c File Reference
#include <stdint.h>
#include "libavutil/intmath.h"
#include "avcodec.h"
#include "bytestream.h"
#include "codec_internal.h"
#include "decode.h"
#include "get_bits.h"
#include "thread.h"
#include "unary.h"

Go to the source code of this file.

Data Structures

struct  SubBand
 
struct  PixletContext
 

Macros

#define NB_LEVELS   4
 
#define PIXLET_MAGIC   0xDEADBEEF
 
#define H   0
 
#define V   1
 

Functions

static av_cold int pixlet_init (AVCodecContext *avctx)
 
static void free_buffers (AVCodecContext *avctx)
 
static av_cold int pixlet_close (AVCodecContext *avctx)
 
static int init_decoder (AVCodecContext *avctx)
 
static int read_low_coeffs (AVCodecContext *avctx, int16_t *dst, int size, int width, ptrdiff_t stride)
 
static int read_high_coeffs (AVCodecContext *avctx, const uint8_t *src, int16_t *dst, int size, int c, int a, int d, int width, ptrdiff_t stride)
 
static int read_highpass (AVCodecContext *avctx, const uint8_t *ptr, int plane, AVFrame *frame)
 
static void lowpass_prediction (int16_t *dst, int16_t *pred, int width, int height, ptrdiff_t stride)
 
static void filterfn (int16_t *dest, int16_t *tmp, unsigned size, int64_t scale)
 
static void reconstruction (AVCodecContext *avctx, int16_t *dest, unsigned width, unsigned height, ptrdiff_t stride, int64_t *scaling_h, int64_t *scaling_v)
 
static void build_luma_lut (AVCodecContext *avctx, int depth)
 
static void postprocess_luma (AVCodecContext *avctx, AVFrame *frame, int w, int h, int depth)
 
static void postprocess_chroma (AVFrame *frame, int w, int h, int depth)
 
static int decode_plane (AVCodecContext *avctx, int plane, const AVPacket *avpkt, AVFrame *frame)
 
static int pixlet_decode_frame (AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt)
 

Variables

const FFCodec ff_pixlet_decoder
 

Macro Definition Documentation

◆ NB_LEVELS

#define NB_LEVELS   4

Definition at line 34 of file pixlet.c.

◆ PIXLET_MAGIC

#define PIXLET_MAGIC   0xDEADBEEF

Definition at line 36 of file pixlet.c.

◆ H

#define H   0

Definition at line 38 of file pixlet.c.

◆ V

#define V   1

Definition at line 39 of file pixlet.c.

Function Documentation

◆ pixlet_init()

static av_cold int pixlet_init ( AVCodecContext avctx)
static

Definition at line 64 of file pixlet.c.

◆ free_buffers()

static void free_buffers ( AVCodecContext avctx)
static

Definition at line 71 of file pixlet.c.

Referenced by pixlet_close(), and pixlet_decode_frame().

◆ pixlet_close()

static av_cold int pixlet_close ( AVCodecContext avctx)
static

Definition at line 80 of file pixlet.c.

◆ init_decoder()

static int init_decoder ( AVCodecContext avctx)
static

Definition at line 89 of file pixlet.c.

Referenced by pixlet_decode_frame().

◆ read_low_coeffs()

static int read_low_coeffs ( AVCodecContext avctx,
int16_t *  dst,
int  size,
int  width,
ptrdiff_t  stride 
)
static

Definition at line 124 of file pixlet.c.

Referenced by decode_plane().

◆ read_high_coeffs()

static int read_high_coeffs ( AVCodecContext avctx,
const uint8_t *  src,
int16_t *  dst,
int  size,
int  c,
int  a,
int  d,
int  width,
ptrdiff_t  stride 
)
static

Definition at line 199 of file pixlet.c.

Referenced by read_highpass().

◆ read_highpass()

static int read_highpass ( AVCodecContext avctx,
const uint8_t *  ptr,
int  plane,
AVFrame frame 
)
static

Definition at line 314 of file pixlet.c.

Referenced by decode_plane().

◆ lowpass_prediction()

static void lowpass_prediction ( int16_t *  dst,
int16_t *  pred,
int  width,
int  height,
ptrdiff_t  stride 
)
static

Definition at line 357 of file pixlet.c.

Referenced by decode_plane().

◆ filterfn()

static void filterfn ( int16_t *  dest,
int16_t *  tmp,
unsigned  size,
int64_t  scale 
)
static

Definition at line 377 of file pixlet.c.

Referenced by reconstruction().

◆ reconstruction()

static void reconstruction ( AVCodecContext avctx,
int16_t *  dest,
unsigned  width,
unsigned  height,
ptrdiff_t  stride,
int64_t scaling_h,
int64_t scaling_v 
)
static

Definition at line 422 of file pixlet.c.

Referenced by decode_plane().

◆ build_luma_lut()

static void build_luma_lut ( AVCodecContext avctx,
int  depth 
)
static

Definition at line 465 of file pixlet.c.

Referenced by pixlet_decode_frame().

◆ postprocess_luma()

static void postprocess_luma ( AVCodecContext avctx,
AVFrame frame,
int  w,
int  h,
int  depth 
)
static

Definition at line 478 of file pixlet.c.

Referenced by pixlet_decode_frame().

◆ postprocess_chroma()

static void postprocess_chroma ( AVFrame frame,
int  w,
int  h,
int  depth 
)
static

Definition at line 502 of file pixlet.c.

Referenced by pixlet_decode_frame().

◆ decode_plane()

static int decode_plane ( AVCodecContext avctx,
int  plane,
const AVPacket avpkt,
AVFrame frame 
)
static

Definition at line 526 of file pixlet.c.

Referenced by pixlet_decode_frame().

◆ pixlet_decode_frame()

static int pixlet_decode_frame ( AVCodecContext avctx,
AVFrame p,
int got_frame,
AVPacket avpkt 
)
static

Definition at line 602 of file pixlet.c.

Variable Documentation

◆ ff_pixlet_decoder

const FFCodec ff_pixlet_decoder
Initial value:
= {
.p.name = "pixlet",
CODEC_LONG_NAME("Apple Pixlet"),
.p.type = AVMEDIA_TYPE_VIDEO,
.init = pixlet_init,
.close = pixlet_close,
.priv_data_size = sizeof(PixletContext),
.p.capabilities = AV_CODEC_CAP_DR1 |
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}

Definition at line 693 of file pixlet.c.

FF_CODEC_CAP_INIT_CLEANUP
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
Definition: codec_internal.h:42
PixletContext
Definition: pixlet.c:47
pixlet_decode_frame
static int pixlet_decode_frame(AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt)
Definition: pixlet.c:602
AV_CODEC_ID_PIXLET
@ AV_CODEC_ID_PIXLET
Definition: codec_id.h:274
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
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
pixlet_init
static av_cold int pixlet_init(AVCodecContext *avctx)
Definition: pixlet.c:64
pixlet_close
static av_cold int pixlet_close(AVCodecContext *avctx)
Definition: pixlet.c:80
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201