FFmpeg
Data Structures | Enumerations | Functions | Variables
magicyuv.c File Reference
#include <stdlib.h>
#include <string.h>
#include "libavutil/pixdesc.h"
#include "libavutil/qsort.h"
#include "avcodec.h"
#include "bytestream.h"
#include "get_bits.h"
#include "huffyuvdsp.h"
#include "internal.h"
#include "lossless_videodsp.h"
#include "thread.h"

Go to the source code of this file.

Data Structures

struct  Slice
 
struct  HuffEntry
 
struct  MagicYUVContext
 

Enumerations

enum  Prediction {
  LEFT = 1, GRADIENT, MEDIAN, LEFT = 1,
  GRADIENT, MEDIAN
}
 

Functions

static int huff_cmp_len (const void *a, const void *b)
 
static int huff_cmp_len10 (const void *a, const void *b)
 
static int huff_cmp_len12 (const void *a, const void *b)
 
static int huff_build10 (VLC *vlc, uint8_t *len)
 
static int huff_build12 (VLC *vlc, uint8_t *len)
 
static int huff_build (VLC *vlc, uint8_t *len)
 
static void magicyuv_median_pred16 (uint16_t *dst, const uint16_t *src1, const uint16_t *diff, intptr_t w, int *left, int *left_top, int max)
 
static int magy_decode_slice10 (AVCodecContext *avctx, void *tdata, int j, int threadnr)
 
static int magy_decode_slice (AVCodecContext *avctx, void *tdata, int j, int threadnr)
 
static int build_huffman (AVCodecContext *avctx, GetBitContext *gbit, int max)
 
static int magy_decode_frame (AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
 
static av_cold int magy_decode_init (AVCodecContext *avctx)
 
static av_cold int magy_decode_end (AVCodecContext *avctx)
 

Variables

AVCodec ff_magicyuv_decoder
 

Enumeration Type Documentation

◆ Prediction

enum Prediction
Enumerator
LEFT 
GRADIENT 
MEDIAN 
LEFT 
GRADIENT 
MEDIAN 

Definition at line 41 of file magicyuv.c.

Function Documentation

◆ huff_cmp_len()

static int huff_cmp_len ( const void *  a,
const void *  b 
)
static

Definition at line 77 of file magicyuv.c.

Referenced by huff_build().

◆ huff_cmp_len10()

static int huff_cmp_len10 ( const void *  a,
const void *  b 
)
static

Definition at line 83 of file magicyuv.c.

Referenced by huff_build10().

◆ huff_cmp_len12()

static int huff_cmp_len12 ( const void *  a,
const void *  b 
)
static

Definition at line 89 of file magicyuv.c.

Referenced by huff_build12().

◆ huff_build10()

static int huff_build10 ( VLC vlc,
uint8_t len 
)
static

Definition at line 95 of file magicyuv.c.

Referenced by magy_decode_frame().

◆ huff_build12()

static int huff_build12 ( VLC vlc,
uint8_t len 
)
static

Definition at line 127 of file magicyuv.c.

Referenced by magy_decode_frame().

◆ huff_build()

static int huff_build ( VLC vlc,
uint8_t len 
)
static

Definition at line 159 of file magicyuv.c.

Referenced by magy_decode_frame().

◆ magicyuv_median_pred16()

static void magicyuv_median_pred16 ( uint16_t *  dst,
const uint16_t *  src1,
const uint16_t *  diff,
intptr_t  w,
int left,
int left_top,
int  max 
)
static

Definition at line 191 of file magicyuv.c.

Referenced by magy_decode_slice10().

◆ magy_decode_slice10()

static int magy_decode_slice10 ( AVCodecContext avctx,
void *  tdata,
int  j,
int  threadnr 
)
static

Definition at line 212 of file magicyuv.c.

Referenced by magy_decode_frame().

◆ magy_decode_slice()

static int magy_decode_slice ( AVCodecContext avctx,
void *  tdata,
int  j,
int  threadnr 
)
static

Definition at line 344 of file magicyuv.c.

Referenced by magy_decode_frame().

◆ build_huffman()

static int build_huffman ( AVCodecContext avctx,
GetBitContext gbit,
int  max 
)
static

Definition at line 476 of file magicyuv.c.

Referenced by magy_decode_frame().

◆ magy_decode_frame()

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

Definition at line 516 of file magicyuv.c.

◆ magy_decode_init()

static av_cold int magy_decode_init ( AVCodecContext avctx)
static

Definition at line 788 of file magicyuv.c.

◆ magy_decode_end()

static av_cold int magy_decode_end ( AVCodecContext avctx)
static

Definition at line 795 of file magicyuv.c.

Variable Documentation

◆ ff_magicyuv_decoder

AVCodec ff_magicyuv_decoder
Initial value:
= {
.name = "magicyuv",
.long_name = NULL_IF_CONFIG_SMALL("MagicYUV video"),
.priv_data_size = sizeof(MagicYUVContext),
.init_thread_copy = ONLY_IF_THREADS_ENABLED(magy_init_thread_copy),
.close = magy_decode_end,
.decode = magy_decode_frame,
.capabilities = AV_CODEC_CAP_DR1 |
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
}

Definition at line 809 of file magicyuv.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:40
init
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
magy_decode_frame
static int magy_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: magicyuv.c:516
MagicYUVContext
Definition: magicyuv.c:53
AV_CODEC_CAP_FRAME_THREADS
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
Definition: avcodec.h:1037
magy_decode_init
static av_cold int magy_decode_init(AVCodecContext *avctx)
Definition: magicyuv.c:788
ONLY_IF_THREADS_ENABLED
#define ONLY_IF_THREADS_ENABLED(x)
Define a function with only the non-default version specified.
Definition: internal.h:227
AV_CODEC_ID_MAGICYUV
@ AV_CODEC_ID_MAGICYUV
Definition: avcodec.h:433
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:981
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:188
init_thread_copy
the pkt_dts and pkt_pts fields in AVFrame will work as usual Restrictions on codec whose streams don t reset across will not work because their bitstreams cannot be decoded in parallel *The contents of buffers must not be read before as well as code calling up to before the decode process starts Call have add an init_thread_copy() which re-allocates them for other threads. Add AV_CODEC_CAP_FRAME_THREADS to the codec capabilities. There will be very little speed gain at this point but it should work. If there are inter-frame dependencies
AV_CODEC_CAP_SLICE_THREADS
#define AV_CODEC_CAP_SLICE_THREADS
Codec supports slice-based (or partition-based) multithreading.
Definition: avcodec.h:1041
magy_decode_end
static av_cold int magy_decode_end(AVCodecContext *avctx)
Definition: magicyuv.c:795
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201