#include <stdlib.h>
#include <string.h>
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/qsort.h"
#include "avcodec.h"
#include "bytestream.h"
#include "encode.h"
#include "put_bits.h"
#include "internal.h"
#include "thread.h"
#include "lossless_videoencdsp.h"
Go to the source code of this file.
|
static void | left_predict (MagicYUVContext *s, uint8_t *src, uint8_t *dst, ptrdiff_t stride, int width, int height) |
|
static void | gradient_predict (MagicYUVContext *s, uint8_t *src, uint8_t *dst, ptrdiff_t stride, int width, int height) |
|
static void | median_predict (MagicYUVContext *s, uint8_t *src, uint8_t *dst, ptrdiff_t stride, int width, int height) |
|
static av_cold int | magy_encode_init (AVCodecContext *avctx) |
|
static void | calculate_codes (HuffEntry *he, uint16_t codes_count[33]) |
|
static void | count_usage (uint8_t *src, int width, int height, PTable *counts) |
|
static int | compare_by_prob (const void *a, const void *b) |
|
static void | magy_huffman_compute_bits (PTable *prob_table, HuffEntry *distincts, uint16_t codes_counts[33], int size, int max_length) |
|
static int | encode_table (AVCodecContext *avctx, uint8_t *dst, int width, int height, PutBitContext *pb, HuffEntry *he) |
|
static int | encode_slice (uint8_t *src, uint8_t *dst, int dst_size, int width, int height, HuffEntry *he, int prediction) |
|
static int | magy_encode_frame (AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet) |
|
static av_cold int | magy_encode_close (AVCodecContext *avctx) |
|
◆ MAGICYUV_EXTRADATA_SIZE
#define MAGICYUV_EXTRADATA_SIZE 32 |
◆ OFFSET
◆ VE
◆ Prediction
Enumerator |
---|
LEFT | |
GRADIENT | |
MEDIAN | |
LEFT | |
GRADIENT | |
MEDIAN | |
Definition at line 39 of file magicyuvenc.c.
◆ left_predict()
static void left_predict |
( |
MagicYUVContext * |
s, |
|
|
uint8_t * |
src, |
|
|
uint8_t * |
dst, |
|
|
ptrdiff_t |
stride, |
|
|
int |
width, |
|
|
int |
height |
|
) |
| |
|
static |
◆ gradient_predict()
static void gradient_predict |
( |
MagicYUVContext * |
s, |
|
|
uint8_t * |
src, |
|
|
uint8_t * |
dst, |
|
|
ptrdiff_t |
stride, |
|
|
int |
width, |
|
|
int |
height |
|
) |
| |
|
static |
◆ median_predict()
static void median_predict |
( |
MagicYUVContext * |
s, |
|
|
uint8_t * |
src, |
|
|
uint8_t * |
dst, |
|
|
ptrdiff_t |
stride, |
|
|
int |
width, |
|
|
int |
height |
|
) |
| |
|
static |
◆ magy_encode_init()
◆ calculate_codes()
static void calculate_codes |
( |
HuffEntry * |
he, |
|
|
uint16_t |
codes_count[33] |
|
) |
| |
|
static |
◆ count_usage()
static void count_usage |
( |
uint8_t * |
src, |
|
|
int |
width, |
|
|
int |
height, |
|
|
PTable * |
counts |
|
) |
| |
|
static |
◆ compare_by_prob()
static int compare_by_prob |
( |
const void * |
a, |
|
|
const void * |
b |
|
) |
| |
|
static |
◆ magy_huffman_compute_bits()
static void magy_huffman_compute_bits |
( |
PTable * |
prob_table, |
|
|
HuffEntry * |
distincts, |
|
|
uint16_t |
codes_counts[33], |
|
|
int |
size, |
|
|
int |
max_length |
|
) |
| |
|
static |
◆ encode_table()
◆ encode_slice()
static int encode_slice |
( |
uint8_t * |
src, |
|
|
uint8_t * |
dst, |
|
|
int |
dst_size, |
|
|
int |
width, |
|
|
int |
height, |
|
|
HuffEntry * |
he, |
|
|
int |
prediction |
|
) |
| |
|
static |
◆ magy_encode_frame()
◆ magy_encode_close()
◆ options
◆ magicyuv_class
Initial value:= {
.class_name = "magicyuv",
}
Definition at line 550 of file magicyuvenc.c.
◆ ff_magicyuv_encoder
Initial value:= {
.name = "magicyuv",
},
}
Definition at line 557 of file magicyuvenc.c.
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
AVPixelFormat
Pixel format.
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
static int magy_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet)
static const AVClass magicyuv_class
static enum AVPixelFormat pix_fmts[]
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
#define LIBAVUTIL_VERSION_INT
const char * av_default_item_name(void *ptr)
Return the context name.
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static const AVOption options[]
@ AV_PIX_FMT_YUVA444P
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
static av_cold int magy_encode_close(AVCodecContext *avctx)
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
static av_cold int magy_encode_init(AVCodecContext *avctx)
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)