FFmpeg
Data Structures | Macros | Functions | Variables
h261enc.c File Reference
#include "libavutil/attributes.h"
#include "libavutil/avassert.h"
#include "libavutil/thread.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "mpegutils.h"
#include "mpegvideo.h"
#include "h261.h"
#include "h261enc.h"
#include "mpegvideoenc.h"

Go to the source code of this file.

Data Structures

struct  VLCLUT
 
struct  H261EncContext
 

Macros

#define H261_MAX_RUN   26
 
#define H261_MAX_LEVEL   15
 
#define H261_ESC_LEN   (6 + 6 + 8)
 

Functions

void ff_h261_encode_picture_header (MpegEncContext *s)
 
static void h261_encode_gob_header (MpegEncContext *s, int mb_line)
 Encode a group of blocks header. More...
 
void ff_h261_reorder_mb_index (MpegEncContext *s)
 
static void h261_encode_motion (PutBitContext *pb, int val)
 
static int get_cbp (MpegEncContext *s, int16_t block[6][64])
 
static void h261_encode_block (H261EncContext *h, int16_t *block, int n)
 Encode an 8x8 block. More...
 
void ff_h261_encode_mb (MpegEncContext *s, int16_t block[6][64], int motion_x, int motion_y)
 
static av_cold void h261_encode_init_static (void)
 
av_cold int ff_h261_encode_init (MpegEncContext *s)
 

Variables

static struct VLCLUT vlc_lut [H261_MAX_RUN+1][32/*0..2 *H261_MAX_LEN are used */]
 
static uint8_t uni_h261_rl_len [64 *128]
 
static uint8_t uni_h261_rl_len_last [64 *128]
 
const FFCodec ff_h261_encoder
 

Detailed Description

H.261 encoder.

Definition in file h261enc.c.

Macro Definition Documentation

◆ H261_MAX_RUN

#define H261_MAX_RUN   26

Definition at line 39 of file h261enc.c.

◆ H261_MAX_LEVEL

#define H261_MAX_LEVEL   15

Definition at line 40 of file h261enc.c.

◆ H261_ESC_LEN

#define H261_ESC_LEN   (6 + 6 + 8)

Definition at line 41 of file h261enc.c.

Function Documentation

◆ ff_h261_encode_picture_header()

void ff_h261_encode_picture_header ( MpegEncContext s)

Definition at line 63 of file h261enc.c.

Referenced by encode_picture().

◆ h261_encode_gob_header()

static void h261_encode_gob_header ( MpegEncContext s,
int  mb_line 
)
static

Encode a group of blocks header.

Definition at line 96 of file h261enc.c.

Referenced by ff_h261_reorder_mb_index().

◆ ff_h261_reorder_mb_index()

void ff_h261_reorder_mb_index ( MpegEncContext s)

Definition at line 113 of file h261enc.c.

Referenced by encode_thread().

◆ h261_encode_motion()

static void h261_encode_motion ( PutBitContext pb,
int  val 
)
static

Definition at line 141 of file h261enc.c.

Referenced by ff_h261_encode_mb().

◆ get_cbp()

static int get_cbp ( MpegEncContext s,
int16_t  block[6][64] 
)
inlinestatic

Definition at line 159 of file h261enc.c.

Referenced by ff_h261_encode_mb().

◆ h261_encode_block()

static void h261_encode_block ( H261EncContext h,
int16_t *  block,
int  n 
)
static

Encode an 8x8 block.

Parameters
blockthe 8x8 block
nblock index (0-3 are luma, 4-5 are chroma)

Definition at line 174 of file h261enc.c.

Referenced by ff_h261_encode_mb().

◆ ff_h261_encode_mb()

void ff_h261_encode_mb ( MpegEncContext s,
int16_t  block[6][64],
int  motion_x,
int  motion_y 
)

Definition at line 234 of file h261enc.c.

Referenced by encode_mb_internal().

◆ h261_encode_init_static()

static av_cold void h261_encode_init_static ( void  )
static

Definition at line 324 of file h261enc.c.

Referenced by ff_h261_encode_init().

◆ ff_h261_encode_init()

av_cold int ff_h261_encode_init ( MpegEncContext s)

Definition at line 346 of file h261enc.c.

Referenced by ff_mpv_encode_init().

Variable Documentation

◆ vlc_lut

struct VLCLUT vlc_lut[H261_MAX_RUN + 1][32 /* 0..2 * H261_MAX_LEN are used */]
static

◆ uni_h261_rl_len

uint8_t uni_h261_rl_len[64 *128]
static

Definition at line 48 of file h261enc.c.

Referenced by ff_h261_encode_init(), and h261_encode_init_static().

◆ uni_h261_rl_len_last

uint8_t uni_h261_rl_len_last[64 *128]
static

Definition at line 49 of file h261enc.c.

Referenced by ff_h261_encode_init(), and h261_encode_init_static().

◆ ff_h261_encoder

const FFCodec ff_h261_encoder
Initial value:
= {
.p.name = "h261",
CODEC_LONG_NAME("H.261"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.priv_class = &ff_mpv_enc_class,
.priv_data_size = sizeof(H261EncContext),
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P,
.color_ranges = AVCOL_RANGE_MPEG,
}

Definition at line 375 of file h261enc.c.

AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:71
ff_mpv_enc_class
const AVClass ff_mpv_enc_class
Definition: mpegvideo_enc.c:105
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:43
H261EncContext
Definition: h261enc.c:51
AV_CODEC_ID_H261
@ AV_CODEC_ID_H261
Definition: codec_id.h:55
ff_mpv_encode_picture
int ff_mpv_encode_picture(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pic_arg, int *got_packet)
Definition: mpegvideo_enc.c:1793
FF_CODEC_ENCODE_CB
#define FF_CODEC_ENCODE_CB(func)
Definition: codec_internal.h:320
AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
This encoder can reorder user opaque values from input AVFrames and return them with corresponding ou...
Definition: codec.h:159
AV_PIX_FMT_YUV420P
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:73
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:296
ff_mpv_encode_end
av_cold int ff_mpv_encode_end(AVCodecContext *avctx)
Definition: mpegvideo_enc.c:1028
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:368
AVCOL_RANGE_MPEG
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
Definition: pixfmt.h:700
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:72
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
ff_mpv_encode_init
av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
Definition: mpegvideo_enc.c:351