#include "config_components.h"
#include "avcodec.h"
#include "bswapdsp.h"
#include "codec_internal.h"
#include "encode.h"
#include "huffyuv.h"
#include "huffman.h"
#include "huffyuvencdsp.h"
#include "lossless_videoencdsp.h"
#include "put_bits.h"
#include "libavutil/emms.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
Go to the source code of this file.
|
static void | diff_bytes (HYuvEncContext *s, uint8_t *dst, const uint8_t *src0, const uint8_t *src1, int w) |
|
static int | sub_left_prediction (HYuvEncContext *s, uint8_t *dst, const uint8_t *src, int w, int left) |
|
static void | sub_left_prediction_bgr32 (HYuvEncContext *s, uint8_t *dst, const uint8_t *src, int w, int *red, int *green, int *blue, int *alpha) |
|
static void | sub_left_prediction_rgb24 (HYuvEncContext *s, uint8_t *dst, const uint8_t *src, int w, int *red, int *green, int *blue) |
|
static void | sub_median_prediction (HYuvEncContext *s, uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int w, int *left, int *left_top) |
|
static int | store_table (HYuvEncContext *s, const uint8_t *len, uint8_t *buf) |
|
static int | store_huffman_tables (HYuvEncContext *s, uint8_t *buf) |
|
static av_cold int | encode_init (AVCodecContext *avctx) |
|
static int | encode_422_bitstream (HYuvEncContext *s, int offset, int count) |
|
static int | encode_plane_bitstream (HYuvEncContext *s, int width, int plane) |
|
static int | encode_gray_bitstream (HYuvEncContext *s, int count) |
|
static int | encode_bgra_bitstream (HYuvEncContext *s, int count, int planes) |
|
static int | encode_frame (AVCodecContext *avctx, AVPacket *pkt, const AVFrame *p, int *got_packet) |
|
static av_cold int | encode_end (AVCodecContext *avctx) |
|
huffyuv encoder
Definition in file huffyuvenc.c.
◆ STATS_OUT_SIZE
#define STATS_OUT_SIZE 21*MAX_N*3 + 4 |
◆ LOAD4
◆ LOADEND
◆ LOADEND_14
#define LOADEND_14 int y0 = s->temp16[0][width-1] & mask; |
◆ LOADEND_16
#define LOADEND_16 int y0 = s->temp16[0][width-1]; |
◆ STATEND
#define STATEND s->stats[plane][y0]++; |
◆ STATEND_16
#define STATEND_16 s->stats[plane][y0>>2]++; |
◆ WRITEEND
◆ WRITEEND_16
Value: put_bits(&
s->pb,
s->len[plane][y0>>2],
s->bits[plane][y0>>2]);\
put_bits(&
s->pb, 2, y0&3);
◆ LOAD2 [1/2]
Value: int y0 =
s->temp[0][2 *
i];\
int y1 =
s->temp[0][2 *
i + 1];
◆ LOAD2_14
Value: int y0 =
s->temp16[0][2 *
i] &
mask;\
int y1 =
s->temp16[0][2 *
i + 1] &
mask;
◆ LOAD2_16
Value: int y0 =
s->temp16[0][2 *
i];\
int y1 =
s->temp16[0][2 *
i + 1];
◆ STAT2 [1/2]
◆ STAT2_16
Value: s->stats[plane][y0>>2]++;\
s->stats[plane][y1>>2]++;
◆ WRITE2 [1/2]
Value: put_bits(&
s->pb,
s->len[plane][y0],
s->bits[plane][y0]);\
put_bits(&
s->pb,
s->len[plane][y1],
s->bits[plane][y1]);
◆ WRITE2_16
Value: put_bits(&
s->pb,
s->len[plane][y0>>2],
s->bits[plane][y0>>2]);\
put_bits(&
s->pb, 2, y0&3);\
put_bits(&
s->pb,
s->len[plane][y1>>2],
s->bits[plane][y1>>2]);\
put_bits(&
s->pb, 2, y1&3);
◆ ENCODE_PLANE
◆ LOAD2 [2/2]
Value: int y0 =
s->temp[0][2 *
i];\
int y1 =
s->temp[0][2 *
i + 1];
◆ STAT2 [2/2]
◆ WRITE2 [2/2]
Value:
put_bits(&
s->pb,
s->len[0][y1],
s->bits[0][y1]);
◆ LOAD_GBRA
Value: int g =
s->temp[0][
planes == 3 ? 3 *
i + 1 : 4 *
i +
G]; \
int
b =(
s->temp[0][
planes == 3 ? 3 *
i + 2 : 4 *
i +
B] -
g) & 0xFF;\
int
r =(
s->temp[0][
planes == 3 ? 3 *
i + 0 : 4 *
i +
R] -
g) & 0xFF;\
◆ STAT_BGRA
◆ WRITE_GBRA
Value:
put_bits(&
s->pb,
s->len[0][
b],
s->bits[0][
b]); \
put_bits(&
s->pb,
s->len[2][
r],
s->bits[2][
r]); \
put_bits(&
s->pb,
s->len[2][
a],
s->bits[2][
a]);
◆ OFFSET
◆ VE
◆ diff_bytes()
static void diff_bytes |
( |
HYuvEncContext * |
s, |
|
|
uint8_t * |
dst, |
|
|
const uint8_t * |
src0, |
|
|
const uint8_t * |
src1, |
|
|
int |
w |
|
) |
| |
|
inlinestatic |
◆ sub_left_prediction()
static int sub_left_prediction |
( |
HYuvEncContext * |
s, |
|
|
uint8_t * |
dst, |
|
|
const uint8_t * |
src, |
|
|
int |
w, |
|
|
int |
left |
|
) |
| |
|
inlinestatic |
◆ sub_left_prediction_bgr32()
static void sub_left_prediction_bgr32 |
( |
HYuvEncContext * |
s, |
|
|
uint8_t * |
dst, |
|
|
const uint8_t * |
src, |
|
|
int |
w, |
|
|
int * |
red, |
|
|
int * |
green, |
|
|
int * |
blue, |
|
|
int * |
alpha |
|
) |
| |
|
inlinestatic |
◆ sub_left_prediction_rgb24()
static void sub_left_prediction_rgb24 |
( |
HYuvEncContext * |
s, |
|
|
uint8_t * |
dst, |
|
|
const uint8_t * |
src, |
|
|
int |
w, |
|
|
int * |
red, |
|
|
int * |
green, |
|
|
int * |
blue |
|
) |
| |
|
inlinestatic |
◆ sub_median_prediction()
static void sub_median_prediction |
( |
HYuvEncContext * |
s, |
|
|
uint8_t * |
dst, |
|
|
const uint8_t * |
src1, |
|
|
const uint8_t * |
src2, |
|
|
int |
w, |
|
|
int * |
left, |
|
|
int * |
left_top |
|
) |
| |
|
static |
◆ store_table()
static int store_table |
( |
HYuvEncContext * |
s, |
|
|
const uint8_t * |
len, |
|
|
uint8_t * |
buf |
|
) |
| |
|
static |
◆ store_huffman_tables()
◆ encode_init()
◆ encode_422_bitstream()
static int encode_422_bitstream |
( |
HYuvEncContext * |
s, |
|
|
int |
offset, |
|
|
int |
count |
|
) |
| |
|
static |
◆ encode_plane_bitstream()
static int encode_plane_bitstream |
( |
HYuvEncContext * |
s, |
|
|
int |
width, |
|
|
int |
plane |
|
) |
| |
|
static |
◆ encode_gray_bitstream()
◆ encode_bgra_bitstream()
static int encode_bgra_bitstream |
( |
HYuvEncContext * |
s, |
|
|
int |
count, |
|
|
int |
planes |
|
) |
| |
|
inlinestatic |
◆ encode_frame()
◆ encode_end()
◆ options
Initial value:= {
{ "non_deterministic", "Allow multithreading for e.g. context=1 at the expense of determinism",
}
Definition at line 992 of file huffyuvenc.c.
◆ normal_class
Initial value:= {
.class_name = "huffyuv",
}
Definition at line 1006 of file huffyuvenc.c.
◆ ff_huffyuv_encoder
Initial value:= {
.p.name = "huffyuv",
},
}
Definition at line 1013 of file huffyuvenc.c.
AVPixelFormat
Pixel format.
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
#define u(width, name, range_min, range_max)
static av_cold int encode_init(AVCodecContext *avctx)
static void put_bits(Jpeg2000EncoderContext *s, int val, int n)
put n times val bit
static const struct @467 planes[]
#define FF_CODEC_ENCODE_CB(func)
#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
This encoder can reorder user opaque values from input AVFrames and return them with corresponding ou...
static const AVClass normal_class
#define CODEC_LONG_NAME(str)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option keep it simple and lowercase description are in without and describe what they for example set the foo of the bar offset is the offset of the field in your context
#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.
static av_cold int encode_end(AVCodecContext *avctx)
static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *p, int *got_packet)
int(* init)(AVBSFContext *ctx)
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
static void predictor(uint8_t *src, ptrdiff_t size)
#define i(width, name, range_min, range_max)
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
@ AV_OPT_TYPE_INT
Underlying C type is int.
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.