FFmpeg
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
h261enc.c
Go to the documentation of this file.
1 /*
2  * H.261 encoder
3  * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
4  * Copyright (c) 2004 Maarten Daniels
5  *
6  * This file is part of FFmpeg.
7  *
8  * FFmpeg is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * FFmpeg is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with FFmpeg; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 
23 /**
24  * @file
25  * H.261 encoder.
26  */
27 
28 #include "libavutil/attributes.h"
29 #include "libavutil/avassert.h"
30 #include "libavutil/thread.h"
31 #include "avcodec.h"
32 #include "codec_internal.h"
33 #include "mpegutils.h"
34 #include "mpegvideo.h"
35 #include "h261.h"
36 #include "h261enc.h"
37 #include "mpegvideoenc.h"
38 #include "put_bits.h"
39 
40 #define H261_MAX_RUN 26
41 #define H261_MAX_LEVEL 15
42 #define H261_ESC_LEN (6 + 6 + 8)
43 #define MV_TAB_OFFSET 32
44 
45 static struct VLCLUT {
46  uint8_t len;
47  uint16_t code;
48 } vlc_lut[H261_MAX_RUN + 1][32 /* 0..2 * H261_MAX_LEN are used */];
49 
50 // Not const despite never being initialized because doing so would
51 // put it into .rodata instead of .bss and bloat the binary.
52 // mv_penalty exists so that the motion estimation code can avoid branches.
53 static uint8_t mv_penalty[MAX_FCODE + 1][MAX_DMV * 2 + 1];
54 static uint8_t uni_h261_rl_len [64 * 128];
55 static uint8_t uni_h261_rl_len_last[64 * 128];
56 static uint8_t h261_mv_codes[64][2];
57 
58 typedef struct H261EncContext {
60 
62 
64  enum {
65  H261_QCIF = 0,
66  H261_CIF = 1,
67  } format;
69 
71 {
72  H261EncContext *const h = (H261EncContext *)m;
73  MPVEncContext *const s = &h->s.s;
74  int temp_ref;
75 
77 
78  put_bits(&s->pb, 20, 0x10); /* PSC */
79 
80  temp_ref = s->c.picture_number * 30000LL * s->c.avctx->time_base.num /
81  (1001LL * s->c.avctx->time_base.den); // FIXME maybe this should use a timestamp
82  put_sbits(&s->pb, 5, temp_ref); /* TemporalReference */
83 
84  put_bits(&s->pb, 1, 0); /* split screen off */
85  put_bits(&s->pb, 1, 0); /* camera off */
86  put_bits(&s->pb, 1, s->c.pict_type == AV_PICTURE_TYPE_I); /* freeze picture release on/off */
87 
88  put_bits(&s->pb, 1, h->format); /* 0 == QCIF, 1 == CIF */
89 
90  put_bits(&s->pb, 1, 1); /* still image mode */
91  put_bits(&s->pb, 1, 1); /* reserved */
92 
93  put_bits(&s->pb, 1, 0); /* no PEI */
94  h->gob_number = h->format - 1;
95  s->c.mb_skip_run = 0;
96 
97  return 0;
98 }
99 
100 /**
101  * Encode a group of blocks header.
102  */
103 static void h261_encode_gob_header(MPVEncContext *const s, int mb_line)
104 {
105  H261EncContext *const h = (H261EncContext *)s;
106  if (h->format == H261_QCIF) {
107  h->gob_number += 2; // QCIF
108  } else {
109  h->gob_number++; // CIF
110  }
111  put_bits(&s->pb, 16, 1); /* GBSC */
112  put_bits(&s->pb, 4, h->gob_number); /* GN */
113  put_bits(&s->pb, 5, s->c.qscale); /* GQUANT */
114  put_bits(&s->pb, 1, 0); /* no GEI */
115  s->c.mb_skip_run = 0;
116  s->c.last_mv[0][0][0] = 0;
117  s->c.last_mv[0][0][1] = 0;
118 }
119 
121 {
122  const H261EncContext *const h = (H261EncContext*)s;
123  int index = s->c.mb_x + s->c.mb_y * s->c.mb_width;
124 
125  if (index % 11 == 0) {
126  if (index % 33 == 0)
128  s->c.last_mv[0][0][0] = 0;
129  s->c.last_mv[0][0][1] = 0;
130  }
131 
132  /* for CIF the GOB's are fragmented in the middle of a scanline
133  * that's why we need to adjust the x and y index of the macroblocks */
134  if (h->format == H261_CIF) {
135  s->c.mb_x = index % 11;
136  index /= 11;
137  s->c.mb_y = index % 3;
138  index /= 3;
139  s->c.mb_x += 11 * (index % 2);
140  index /= 2;
141  s->c.mb_y += 3 * index;
142 
143  ff_init_block_index(&s->c);
144  ff_update_block_index(&s->c, 8, 0, 1);
145  }
146 }
147 
148 static void h261_encode_motion(PutBitContext *pb, int val)
149 {
152 }
153 
154 static inline int get_cbp(const int block_last_index[6])
155 {
156  int i, cbp;
157  cbp = 0;
158  for (i = 0; i < 6; i++)
159  if (block_last_index[i] >= 0)
160  cbp |= 1 << (5 - i);
161  return cbp;
162 }
163 
164 /**
165  * Encode an 8x8 block.
166  * @param block the 8x8 block
167  * @param n block index (0-3 are luma, 4-5 are chroma)
168  */
169 static void h261_encode_block(H261EncContext *h, int16_t *block, int n)
170 {
171  MPVEncContext *const s = &h->s.s;
172  int level, run, i, j, last_index, last_non_zero;
173 
174  if (s->c.mb_intra) {
175  /* DC coef */
176  level = block[0];
177  /* 255 cannot be represented, so we clamp */
178  if (level > 254) {
179  level = 254;
180  block[0] = 254;
181  }
182  /* 0 cannot be represented also */
183  else if (level < 1) {
184  level = 1;
185  block[0] = 1;
186  }
187  if (level == 128)
188  put_bits(&s->pb, 8, 0xff);
189  else
190  put_bits(&s->pb, 8, level);
191  i = 1;
192  } else if ((block[0] == 1 || block[0] == -1) &&
193  (s->c.block_last_index[n] > -1)) {
194  // special case
195  put_bits(&s->pb, 2, block[0] > 0 ? 2 : 3);
196  i = 1;
197  } else {
198  i = 0;
199  }
200 
201  /* AC coefs */
202  last_index = s->c.block_last_index[n];
203  last_non_zero = i - 1;
204  for (; i <= last_index; i++) {
205  j = s->c.intra_scantable.permutated[i];
206  level = block[j];
207  if (level) {
208  run = i - last_non_zero - 1;
209 
210  if (run <= H261_MAX_RUN &&
211  (unsigned)(level + H261_MAX_LEVEL) <= 2 * H261_MAX_LEVEL &&
215  } else {
216  /* Escape */
217  put_bits(&s->pb, 6 + 6, (1 << 6) | run);
218  av_assert1(level != 0);
219  av_assert1(FFABS(level) <= 127);
220  put_sbits(&s->pb, 8, level);
221  }
222  last_non_zero = i;
223  }
224  }
225  if (last_index > -1)
226  put_bits(&s->pb, 2, 0x2); // EOB
227 }
228 
229 static void h261_encode_mb(MPVEncContext *const s, int16_t block[6][64],
230  int motion_x, int motion_y)
231 {
232  /* The following is only allowed because this encoder
233  * does not use slice threading. */
234  H261EncContext *const h = (H261EncContext *)s;
235  H261Context *const com = &h->common;
236  int mvd, mv_diff_x, mv_diff_y, i, cbp;
237  cbp = 63; // avoid warning
238  mvd = 0;
239 
240  com->mtype = 0;
241 
242  if (!s->c.mb_intra) {
243  /* compute cbp */
244  cbp = get_cbp(s->c.block_last_index);
245 
246  /* mvd indicates if this block is motion compensated */
247  mvd = motion_x | motion_y;
248 
249  if ((cbp | mvd) == 0) {
250  /* skip macroblock */
251  s->c.mb_skip_run++;
252  s->c.last_mv[0][0][0] = 0;
253  s->c.last_mv[0][0][1] = 0;
254  s->c.qscale -= s->dquant;
255  return;
256  }
257  }
258 
259  /* MB is not skipped, encode MBA */
260  put_bits(&s->pb,
261  ff_h261_mba_bits[s->c.mb_skip_run],
262  ff_h261_mba_code[s->c.mb_skip_run]);
263  s->c.mb_skip_run = 0;
264 
265  /* calculate MTYPE */
266  if (!s->c.mb_intra) {
267  com->mtype++;
268 
269  if (mvd || s->c.loop_filter)
270  com->mtype += 3;
271  if (s->c.loop_filter)
272  com->mtype += 3;
273  if (cbp)
274  com->mtype++;
275  av_assert1(com->mtype > 1);
276  }
277 
278  if (s->dquant && cbp) {
279  com->mtype++;
280  } else
281  s->c.qscale -= s->dquant;
282 
283  put_bits(&s->pb,
285  ff_h261_mtype_code[com->mtype]);
286 
287  com->mtype = ff_h261_mtype_map[com->mtype];
288 
289  if (IS_QUANT(com->mtype)) {
290  ff_set_qscale(&s->c, s->c.qscale + s->dquant);
291  put_bits(&s->pb, 5, s->c.qscale);
292  }
293 
294  if (IS_16X16(com->mtype)) {
295  mv_diff_x = (motion_x >> 1) - s->c.last_mv[0][0][0];
296  mv_diff_y = (motion_y >> 1) - s->c.last_mv[0][0][1];
297  s->c.last_mv[0][0][0] = (motion_x >> 1);
298  s->c.last_mv[0][0][1] = (motion_y >> 1);
299  h261_encode_motion(&s->pb, mv_diff_x);
300  h261_encode_motion(&s->pb, mv_diff_y);
301  }
302 
303  if (HAS_CBP(com->mtype)) {
304  av_assert1(cbp > 0);
305  put_bits(&s->pb,
306  ff_h261_cbp_tab[cbp - 1][1],
307  ff_h261_cbp_tab[cbp - 1][0]);
308  }
309  for (i = 0; i < 6; i++)
310  /* encode each block */
312 
313  if (!IS_16X16(com->mtype)) {
314  s->c.last_mv[0][0][0] = 0;
315  s->c.last_mv[0][0][1] = 0;
316  }
317 }
318 
320 {
321  uint8_t (*const mv_codes)[2] = h261_mv_codes + MV_TAB_OFFSET;
322  memset(uni_h261_rl_len, H261_ESC_LEN, sizeof(uni_h261_rl_len));
323  memset(uni_h261_rl_len_last, H261_ESC_LEN + 2 /* EOB */, sizeof(uni_h261_rl_len_last));
324 
325  // The following loop is over the ordinary elements, not EOB or escape.
326  for (size_t i = 1; i < FF_ARRAY_ELEMS(ff_h261_tcoeff_vlc) - 1; i++) {
327  unsigned run = ff_h261_tcoeff_run[i];
328  unsigned level = ff_h261_tcoeff_level[i];
329  unsigned len = ff_h261_tcoeff_vlc[i][1] + 1 /* sign */;
330  unsigned code = ff_h261_tcoeff_vlc[i][0];
331 
332  vlc_lut[run][H261_MAX_LEVEL + level] = (struct VLCLUT){ len, code << 1 };
333  vlc_lut[run][H261_MAX_LEVEL - level] = (struct VLCLUT){ len, (code << 1) | 1 };
334 
339  }
340 
341  for (ptrdiff_t i = 1;; i++) {
342  // sign-one MV codes; diff -16..-1, 16..31
343  mv_codes[32 - i][0] = mv_codes[-i][0] = (ff_h261_mv_tab[i][0] << 1) | 1 /* sign */;
344  mv_codes[32 - i][1] = mv_codes[-i][1] = ff_h261_mv_tab[i][1] + 1;
345  if (i == 16)
346  break;
347  // sign-zero MV codes: diff -31..-17, 1..15
348  mv_codes[i][0] = mv_codes[i - 32][0] = ff_h261_mv_tab[i][0] << 1;
349  mv_codes[i][1] = mv_codes[i - 32][1] = ff_h261_mv_tab[i][1] + 1;
350  }
351  // MV code for difference zero; has no sign
352  mv_codes[0][0] = 1;
353  mv_codes[0][1] = 1;
354 }
355 
357 {
358  static AVOnce init_static_once = AV_ONCE_INIT;
359  H261EncContext *const h = avctx->priv_data;
360  MPVEncContext *const s = &h->s.s;
361 
362  if (avctx->width == 176 && avctx->height == 144) {
363  h->format = H261_QCIF;
364  } else if (avctx->width == 352 && avctx->height == 288) {
365  h->format = H261_CIF;
366  } else {
367  av_log(avctx, AV_LOG_ERROR,
368  "The specified picture size of %dx%d is not valid for the "
369  "H.261 codec.\nValid sizes are 176x144, 352x288\n",
370  avctx->width, avctx->height);
371  return AVERROR(EINVAL);
372  }
373  s->c.private_ctx = &h->common;
374  h->s.encode_picture_header = h261_encode_picture_header;
375  s->encode_mb = h261_encode_mb;
376 
377  s->min_qcoeff = -127;
378  s->max_qcoeff = 127;
379  s->ac_esc_length = H261_ESC_LEN;
380 
381  s->me.mv_penalty = mv_penalty;
382 
383  s->intra_ac_vlc_length = s->inter_ac_vlc_length = uni_h261_rl_len;
384  s->intra_ac_vlc_last_length = s->inter_ac_vlc_last_length = uni_h261_rl_len_last;
385  ff_thread_once(&init_static_once, h261_encode_init_static);
386 
387  return ff_mpv_encode_init(avctx);
388 }
389 
391  .p.name = "h261",
392  CODEC_LONG_NAME("H.261"),
393  .p.type = AVMEDIA_TYPE_VIDEO,
394  .p.id = AV_CODEC_ID_H261,
395  .p.priv_class = &ff_mpv_enc_class,
397  .priv_data_size = sizeof(H261EncContext),
400  .close = ff_mpv_encode_end,
401  .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
403  .color_ranges = AVCOL_RANGE_MPEG,
404 };
h261_encode_mb
static void h261_encode_mb(MPVEncContext *const s, int16_t block[6][64], int motion_x, int motion_y)
Definition: h261enc.c:229
CODEC_PIXFMTS
#define CODEC_PIXFMTS(...)
Definition: codec_internal.h:386
ff_mpv_enc_class
const AVClass ff_mpv_enc_class
Definition: mpegvideo_enc.c:104
level
uint8_t level
Definition: svq3.c:208
MPVEncContext
Definition: mpegvideoenc.h:45
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:42
H261EncContext
Definition: h261enc.c:58
AVERROR
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
H261Context::mtype
int mtype
Definition: h261.h:38
MAX_FCODE
#define MAX_FCODE
Definition: mpegvideoenc.h:264
thread.h
ff_h261_tcoeff_run
const int8_t ff_h261_tcoeff_run[64]
Definition: h261data.c:138
mpegvideoenc.h
put_sbits
static void put_sbits(PutBitContext *pb, int n, int32_t value)
Definition: put_bits.h:291
H261EncContext::common
H261Context common
Definition: h261enc.c:61
H261EncContext::format
enum H261EncContext::@130 format
VLCLUT::code
uint16_t code
Definition: h261enc.c:47
put_bits
static void put_bits(Jpeg2000EncoderContext *s, int val, int n)
put n times val bit
Definition: j2kenc.c:223
MAX_DMV
#define MAX_DMV
Definition: motion_est.h:39
mv_penalty
static uint8_t mv_penalty[MAX_FCODE+1][MAX_DMV *2+1]
Definition: h261enc.c:53
FFCodec
Definition: codec_internal.h:127
ff_init_block_index
void ff_init_block_index(MpegEncContext *s)
Definition: mpegvideo.c:514
mpegvideo.h
H261EncContext::s
MPVMainEncContext s
Definition: h261enc.c:59
mpegutils.h
AV_CODEC_ID_H261
@ AV_CODEC_ID_H261
Definition: codec_id.h:55
ff_h261_encoder
const FFCodec ff_h261_encoder
Definition: h261enc.c:390
ff_mpv_encode_picture
int ff_mpv_encode_picture(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pic_arg, int *got_packet)
Definition: mpegvideo_enc.c:1929
FFCodec::p
AVCodec p
The public AVCodec.
Definition: codec_internal.h:131
H261_MAX_LEVEL
#define H261_MAX_LEVEL
Definition: h261enc.c:41
h261.h
val
static double val(void *priv, double ch)
Definition: aeval.c:77
FF_CODEC_ENCODE_CB
#define FF_CODEC_ENCODE_CB(func)
Definition: codec_internal.h:353
HAS_CBP
#define HAS_CBP(a)
Definition: mpegutils.h:87
avassert.h
ff_thread_once
static int ff_thread_once(char *control, void(*routine)(void))
Definition: thread.h:205
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:210
FF_ARRAY_ELEMS
#define FF_ARRAY_ELEMS(a)
Definition: sinewin_tablegen.c:29
av_cold
#define av_cold
Definition: attributes.h:90
s
#define s(width, name)
Definition: cbs_vp9.c:198
VLCLUT
Definition: h261enc.c:45
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:144
ff_h261_mba_code
const uint8_t ff_h261_mba_code[35]
Definition: h261data.c:34
MV_TAB_OFFSET
#define MV_TAB_OFFSET
Definition: h261enc.c:43
vlc_lut
static struct VLCLUT vlc_lut[H261_MAX_RUN+1][32/*0..2 *H261_MAX_LEN are used */]
ff_h261_mv_tab
const uint8_t ff_h261_mv_tab[17][2]
Definition: h261data.c:89
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
PutBitContext
Definition: put_bits.h:50
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:326
FFABS
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
Definition: common.h:74
AV_ONCE_INIT
#define AV_ONCE_INIT
Definition: thread.h:203
h261_encode_block
static void h261_encode_block(H261EncContext *h, int16_t *block, int n)
Encode an 8x8 block.
Definition: h261enc.c:169
run
uint8_t run
Definition: svq3.c:207
AV_PICTURE_TYPE_I
@ AV_PICTURE_TYPE_I
Intra.
Definition: avutil.h:278
ff_set_qscale
void ff_set_qscale(MpegEncContext *s, int qscale)
set qscale and update qscale dependent variables.
Definition: mpegvideo.c:547
ff_mpv_encode_end
av_cold int ff_mpv_encode_end(AVCodecContext *avctx)
Definition: mpegvideo_enc.c:1107
ff_h261_reorder_mb_index
void ff_h261_reorder_mb_index(MPVEncContext *const s)
Definition: h261enc.c:120
ff_h261_tcoeff_level
const int8_t ff_h261_tcoeff_level[64]
Definition: h261data.c:127
MPVMainEncContext
Definition: mpegvideoenc.h:178
AVOnce
#define AVOnce
Definition: thread.h:202
H261_MAX_RUN
#define H261_MAX_RUN
Definition: h261enc.c:40
index
int index
Definition: gxfenc.c:90
uni_h261_rl_len_last
static uint8_t uni_h261_rl_len_last[64 *128]
Definition: h261enc.c:55
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:368
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
codec_internal.h
ff_update_block_index
static void ff_update_block_index(MpegEncContext *s, int bits_per_raw_sample, int lowres, int chroma_x_shift)
Definition: mpegvideo.h:382
put_bits_assume_flushed
static void put_bits_assume_flushed(const PutBitContext *s)
Inform the compiler that a PutBitContext is flushed (i.e.
Definition: put_bits.h:82
attributes.h
H261EncContext::gob_number
int gob_number
Definition: h261enc.c:63
get_cbp
static int get_cbp(const int block_last_index[6])
Definition: h261enc.c:154
ff_h261_tcoeff_vlc
const uint16_t ff_h261_tcoeff_vlc[65][2]
Definition: h261data.c:107
UNI_AC_ENC_INDEX
#define UNI_AC_ENC_INDEX(run, level)
Definition: mpegvideoenc.h:265
IS_16X16
#define IS_16X16(a)
Definition: mpegutils.h:80
H261Context
H261Context.
Definition: h261.h:37
h261_encode_init_static
static av_cold void h261_encode_init_static(void)
Definition: h261enc.c:319
h261_encode_picture_header
static int h261_encode_picture_header(MPVMainEncContext *const m)
Definition: h261enc.c:70
ff_h261_cbp_tab
const uint8_t ff_h261_cbp_tab[63][2]
Definition: h261data.c:95
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:256
code
and forward the test the status of outputs and forward it to the corresponding return FFERROR_NOT_READY If the filters stores internally one or a few frame for some it can consider them to be part of the FIFO and delay acknowledging a status change accordingly Example code
Definition: filter_design.txt:178
av_assert1
#define av_assert1(cond)
assert() equivalent, that does not lie in speed critical code.
Definition: avassert.h:57
IS_QUANT
#define IS_QUANT(a)
Definition: mpegutils.h:85
ff_h261_mtype_code
const uint8_t ff_h261_mtype_code[10]
Definition: h261data.c:63
uni_h261_rl_len
static uint8_t uni_h261_rl_len[64 *128]
Definition: h261enc.c:54
AVCodec::name
const char * name
Name of the codec implementation.
Definition: codec.h:179
len
int len
Definition: vorbis_enc_data.h:426
AVCodecContext::height
int height
Definition: avcodec.h:592
AVCOL_RANGE_MPEG
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
Definition: pixfmt.h:733
avcodec.h
AVCodecContext
main external API structure.
Definition: avcodec.h:431
h261enc.h
h261_mv_codes
static uint8_t h261_mv_codes[64][2]
Definition: h261enc.c:56
ff_h261_mtype_map
const uint16_t ff_h261_mtype_map[10]
Definition: h261data.c:75
ff_h261_mtype_bits
const uint8_t ff_h261_mtype_bits[10]
Definition: h261data.c:69
h261_encode_init
static av_cold int h261_encode_init(AVCodecContext *avctx)
Definition: h261enc.c:356
VLCLUT::len
uint8_t len
Definition: h261enc.c:46
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:200
ff_mpv_encode_init
av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
Definition: mpegvideo_enc.c:545
h261_encode_motion
static void h261_encode_motion(PutBitContext *pb, int val)
Definition: h261enc.c:148
AVCodecContext::priv_data
void * priv_data
Definition: avcodec.h:458
H261EncContext::H261_CIF
@ H261_CIF
Definition: h261enc.c:66
H261EncContext::H261_QCIF
@ H261_QCIF
Definition: h261enc.c:65
AVCodecContext::width
int width
picture width / height.
Definition: avcodec.h:592
block
The exact code depends on how similar the blocks are and how related they are to the block
Definition: filter_design.txt:207
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
h261_encode_gob_header
static void h261_encode_gob_header(MPVEncContext *const s, int mb_line)
Encode a group of blocks header.
Definition: h261enc.c:103
h
h
Definition: vp9dsp_template.c:2070
H261_ESC_LEN
#define H261_ESC_LEN
Definition: h261enc.c:42
ff_h261_mba_bits
const uint8_t ff_h261_mba_bits[35]
Definition: h261data.c:48
put_bits.h