huffyuvenc.c File Reference

huffyuv encoder More...

#include "avcodec.h"
#include "huffyuv.h"
#include "huffman.h"
#include "internal.h"
#include "put_bits.h"
Include dependency graph for huffyuvenc.c:

Go to the source code of this file.

Macros

#define LOAD4
 
#define LOAD2
 
#define STAT2
 
#define WRITE2
 
#define LOAD3
 
#define STAT3
 
#define WRITE3
 

Functions

static int sub_left_prediction (HYuvContext *s, uint8_t *dst, const uint8_t *src, int w, int left)
 
static void sub_left_prediction_bgr32 (HYuvContext *s, uint8_t *dst, const uint8_t *src, int w, int *red, int *green, int *blue, int *alpha)
 
static void sub_left_prediction_rgb24 (HYuvContext *s, uint8_t *dst, const uint8_t *src, int w, int *red, int *green, int *blue)
 
static int store_table (HYuvContext *s, const uint8_t *len, uint8_t *buf)
 
static av_cold int encode_init (AVCodecContext *avctx)
 
static int encode_422_bitstream (HYuvContext *s, int offset, int count)
 
static int encode_gray_bitstream (HYuvContext *s, int count)
 
static int encode_bgra_bitstream (HYuvContext *s, int count, int planes)
 
static int encode_frame (AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet)
 
static av_cold int encode_end (AVCodecContext *avctx)
 

Detailed Description

huffyuv encoder

Definition in file huffyuvenc.c.

Macro Definition Documentation

#define LOAD2
Value:
int y0 = s->temp[0][2 * i];\
int y1 = s->temp[0][2 * i + 1];
const char * s
Definition: avisynth_c.h:668
y1
Definition: lab5.m:33
synthesis window for stochastic i

Referenced by encode_gray_bitstream().

#define LOAD3
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;\
int a = s->temp[0][planes*i + A];
const char * s
Definition: avisynth_c.h:668
#define B
Definition: dsputil.c:2025
#define b
Definition: input.c:42
#define R
Definition: dsputil.c:2027
#define A(x)
const char * r
Definition: vf_curves.c:94
FFT buffer for g
Definition: stft_peak.m:17
synthesis window for stochastic i
#define G
Definition: dsputil.c:2026

Referenced by encode_bgra_bitstream().

#define LOAD4
Value:
int y0 = y[2 * i];\
int y1 = y[2 * i + 1];\
int u0 = u[i];\
int v0 = v[i];
float v
y1
Definition: lab5.m:33
float u
synthesis window for stochastic i
#define v0
Definition: regdef.h:26
function y
Definition: D.m:1

Referenced by encode_422_bitstream().

#define STAT2
Value:
s->stats[0][y0]++;\
s->stats[0][y1]++;
const char * s
Definition: avisynth_c.h:668
y1
Definition: lab5.m:33

Referenced by encode_gray_bitstream().

#define STAT3
Value:
s->stats[0][b]++;\
s->stats[1][g]++;\
s->stats[2][r]++;\
if(planes==4) s->stats[2][a]++;
const char * s
Definition: avisynth_c.h:668
initialize output if(nPeaks >3)%at least 3 peaks in spectrum for trying to find f0 nf0peaks
#define b
Definition: input.c:42
const char * r
Definition: vf_curves.c:94
FFT buffer for g
Definition: stft_peak.m:17

Referenced by encode_bgra_bitstream().

#define WRITE2
Value:
put_bits(&s->pb, s->len[0][y0], s->bits[0][y0]);\
put_bits(&s->pb, s->len[0][y1], s->bits[0][y1]);
const char * s
Definition: avisynth_c.h:668
y1
Definition: lab5.m:33
static void put_bits(J2kEncoderContext *s, int val, int n)
put n times val bit
Definition: j2kenc.c:160

Referenced by encode_gray_bitstream().

#define WRITE3
Value:
put_bits(&s->pb, s->len[1][g], s->bits[1][g]);\
put_bits(&s->pb, s->len[0][b], s->bits[0][b]);\
put_bits(&s->pb, s->len[2][r], s->bits[2][r]);\
if(planes==4) put_bits(&s->pb, s->len[2][a], s->bits[2][a]);
const char * s
Definition: avisynth_c.h:668
initialize output if(nPeaks >3)%at least 3 peaks in spectrum for trying to find f0 nf0peaks
uint8_t bits
Definition: crc.c:216
#define b
Definition: input.c:42
const char * r
Definition: vf_curves.c:94
static void put_bits(J2kEncoderContext *s, int val, int n)
put n times val bit
Definition: j2kenc.c:160
FFT buffer for g
Definition: stft_peak.m:17
int len

Referenced by encode_bgra_bitstream().

Function Documentation

static int encode_422_bitstream ( HYuvContext s,
int  offset,
int  count 
)
static

Definition at line 283 of file huffyuvenc.c.

Referenced by encode_frame().

static int encode_bgra_bitstream ( HYuvContext s,
int  count,
int  planes 
)
inlinestatic

Definition at line 383 of file huffyuvenc.c.

Referenced by encode_frame().

static av_cold int encode_end ( AVCodecContext avctx)
static

Definition at line 658 of file huffyuvenc.c.

static int encode_frame ( AVCodecContext avctx,
AVPacket pkt,
const AVFrame pict,
int *  got_packet 
)
static

Definition at line 429 of file huffyuvenc.c.

Referenced by encode_end().

static int encode_gray_bitstream ( HYuvContext s,
int  count 
)
static

Definition at line 338 of file huffyuvenc.c.

Referenced by encode_frame().

static av_cold int encode_init ( AVCodecContext avctx)
static

Definition at line 139 of file huffyuvenc.c.

Referenced by encode_end().

static int store_table ( HYuvContext s,
const uint8_t len,
uint8_t buf 
)
static

Definition at line 115 of file huffyuvenc.c.

Referenced by encode_frame(), and encode_init().

static int sub_left_prediction ( HYuvContext s,
uint8_t dst,
const uint8_t src,
int  w,
int  left 
)
inlinestatic

Definition at line 35 of file huffyuvenc.c.

Referenced by encode_frame().

static void sub_left_prediction_bgr32 ( HYuvContext s,
uint8_t dst,
const uint8_t src,
int  w,
int *  red,
int *  green,
int *  blue,
int *  alpha 
)
inlinestatic

Definition at line 57 of file huffyuvenc.c.

Referenced by encode_frame().

static void sub_left_prediction_rgb24 ( HYuvContext s,
uint8_t dst,
const uint8_t src,
int  w,
int *  red,
int *  green,
int *  blue 
)
inlinestatic

Definition at line 90 of file huffyuvenc.c.

Referenced by encode_frame().