FFmpeg
Macros | Enumerations | Functions
mpegutils.h File Reference
#include <stdint.h>
#include "libavutil/frame.h"
#include "avcodec.h"

Go to the source code of this file.

Macros

#define FRAME_SKIPPED   100
 Return value for header parsers if frame is not coded. More...
 
#define PICT_TOP_FIELD   1
 
#define PICT_BOTTOM_FIELD   2
 
#define PICT_FRAME   3
 
#define MAX_MB_BYTES   (30 * 16 * 16 * 3 / 8 + 120)
 
#define MAX_FCODE   7
 
#define MB_TYPE_INTRA4x4   (1 << 0)
 
#define MB_TYPE_INTRA16x16   (1 << 1)
 
#define MB_TYPE_INTRA_PCM   (1 << 2)
 
#define MB_TYPE_16x16   (1 << 3)
 
#define MB_TYPE_16x8   (1 << 4)
 
#define MB_TYPE_8x16   (1 << 5)
 
#define MB_TYPE_8x8   (1 << 6)
 
#define MB_TYPE_INTERLACED   (1 << 7)
 
#define MB_TYPE_DIRECT2   (1 << 8)
 
#define MB_TYPE_ACPRED   (1 << 9)
 
#define MB_TYPE_GMC   (1 << 10)
 
#define MB_TYPE_SKIP   (1 << 11)
 
#define MB_TYPE_P0L0   (1 << 12)
 
#define MB_TYPE_P1L0   (1 << 13)
 
#define MB_TYPE_P0L1   (1 << 14)
 
#define MB_TYPE_P1L1   (1 << 15)
 
#define MB_TYPE_L0   (MB_TYPE_P0L0 | MB_TYPE_P1L0)
 
#define MB_TYPE_L1   (MB_TYPE_P0L1 | MB_TYPE_P1L1)
 
#define MB_TYPE_L0L1   (MB_TYPE_L0 | MB_TYPE_L1)
 
#define MB_TYPE_QUANT   (1 << 16)
 
#define MB_TYPE_CBP   (1 << 17)
 
#define MB_TYPE_INTRA   MB_TYPE_INTRA4x4
 
#define IS_INTRA4x4(a)   ((a) & MB_TYPE_INTRA4x4)
 
#define IS_INTRA16x16(a)   ((a) & MB_TYPE_INTRA16x16)
 
#define IS_PCM(a)   ((a) & MB_TYPE_INTRA_PCM)
 
#define IS_INTRA(a)   ((a) & 7)
 
#define IS_INTER(a)
 
#define IS_SKIP(a)   ((a) & MB_TYPE_SKIP)
 
#define IS_INTRA_PCM(a)   ((a) & MB_TYPE_INTRA_PCM)
 
#define IS_INTERLACED(a)   ((a) & MB_TYPE_INTERLACED)
 
#define IS_DIRECT(a)   ((a) & MB_TYPE_DIRECT2)
 
#define IS_GMC(a)   ((a) & MB_TYPE_GMC)
 
#define IS_16X16(a)   ((a) & MB_TYPE_16x16)
 
#define IS_16X8(a)   ((a) & MB_TYPE_16x8)
 
#define IS_8X16(a)   ((a) & MB_TYPE_8x16)
 
#define IS_8X8(a)   ((a) & MB_TYPE_8x8)
 
#define IS_SUB_8X8(a)   ((a) & MB_TYPE_16x16)
 
#define IS_SUB_8X4(a)   ((a) & MB_TYPE_16x8)
 
#define IS_SUB_4X8(a)   ((a) & MB_TYPE_8x16)
 
#define IS_SUB_4X4(a)   ((a) & MB_TYPE_8x8)
 
#define IS_ACPRED(a)   ((a) & MB_TYPE_ACPRED)
 
#define IS_QUANT(a)   ((a) & MB_TYPE_QUANT)
 
#define IS_DIR(a, part, list)   ((a) & (MB_TYPE_P0L0 << ((part) + 2 * (list))))
 
#define USES_LIST(a, list)   ((a) & ((MB_TYPE_P0L0 | MB_TYPE_P1L0) << (2 * (list))))
 
#define HAS_CBP(a)   ((a) & MB_TYPE_CBP)
 
#define CANDIDATE_MB_TYPE_INTRA   (1 << 0)
 
#define CANDIDATE_MB_TYPE_INTER   (1 << 1)
 
#define CANDIDATE_MB_TYPE_INTER4V   (1 << 2)
 
#define CANDIDATE_MB_TYPE_SKIPPED   (1 << 3)
 
#define CANDIDATE_MB_TYPE_DIRECT   (1 << 4)
 
#define CANDIDATE_MB_TYPE_FORWARD   (1 << 5)
 
#define CANDIDATE_MB_TYPE_BACKWARD   (1 << 6)
 
#define CANDIDATE_MB_TYPE_BIDIR   (1 << 7)
 
#define CANDIDATE_MB_TYPE_INTER_I   (1 << 8)
 
#define CANDIDATE_MB_TYPE_FORWARD_I   (1 << 9)
 
#define CANDIDATE_MB_TYPE_BACKWARD_I   (1 << 10)
 
#define CANDIDATE_MB_TYPE_BIDIR_I   (1 << 11)
 
#define CANDIDATE_MB_TYPE_DIRECT0   (1 << 12)
 
#define INPLACE_OFFSET   16
 

Enumerations

enum  OutputFormat {
  FMT_MPEG1, FMT_H261, FMT_H263, FMT_MJPEG,
  FMT_SPEEDHQ
}
 

Functions

void ff_draw_horiz_band (AVCodecContext *avctx, const AVFrame *cur, const AVFrame *last, int y, int h, int picture_structure, int first_field, int low_delay)
 Draw a horizontal band if supported. More...
 
void ff_print_debug_info2 (AVCodecContext *avctx, AVFrame *pict, const uint8_t *mbskip_table, const uint32_t *mbtype_table, const int8_t *qscale_table, int16_t(*const motion_val[2])[2], int mb_width, int mb_height, int mb_stride, int quarter_sample)
 Print debugging info for the given picture. More...
 

Macro Definition Documentation

◆ FRAME_SKIPPED

#define FRAME_SKIPPED   100

Return value for header parsers if frame is not coded.

Definition at line 33 of file mpegutils.h.

◆ PICT_TOP_FIELD

#define PICT_TOP_FIELD   1

Definition at line 36 of file mpegutils.h.

◆ PICT_BOTTOM_FIELD

#define PICT_BOTTOM_FIELD   2

Definition at line 37 of file mpegutils.h.

◆ PICT_FRAME

#define PICT_FRAME   3

Definition at line 38 of file mpegutils.h.

◆ MAX_MB_BYTES

#define MAX_MB_BYTES   (30 * 16 * 16 * 3 / 8 + 120)

Definition at line 40 of file mpegutils.h.

◆ MAX_FCODE

#define MAX_FCODE   7

Definition at line 41 of file mpegutils.h.

◆ MB_TYPE_INTRA4x4

#define MB_TYPE_INTRA4x4   (1 << 0)

Definition at line 44 of file mpegutils.h.

◆ MB_TYPE_INTRA16x16

#define MB_TYPE_INTRA16x16   (1 << 1)

Definition at line 45 of file mpegutils.h.

◆ MB_TYPE_INTRA_PCM

#define MB_TYPE_INTRA_PCM   (1 << 2)

Definition at line 46 of file mpegutils.h.

◆ MB_TYPE_16x16

#define MB_TYPE_16x16   (1 << 3)

Definition at line 47 of file mpegutils.h.

◆ MB_TYPE_16x8

#define MB_TYPE_16x8   (1 << 4)

Definition at line 48 of file mpegutils.h.

◆ MB_TYPE_8x16

#define MB_TYPE_8x16   (1 << 5)

Definition at line 49 of file mpegutils.h.

◆ MB_TYPE_8x8

#define MB_TYPE_8x8   (1 << 6)

Definition at line 50 of file mpegutils.h.

◆ MB_TYPE_INTERLACED

#define MB_TYPE_INTERLACED   (1 << 7)

Definition at line 51 of file mpegutils.h.

◆ MB_TYPE_DIRECT2

#define MB_TYPE_DIRECT2   (1 << 8)

Definition at line 52 of file mpegutils.h.

◆ MB_TYPE_ACPRED

#define MB_TYPE_ACPRED   (1 << 9)

Definition at line 53 of file mpegutils.h.

◆ MB_TYPE_GMC

#define MB_TYPE_GMC   (1 << 10)

Definition at line 54 of file mpegutils.h.

◆ MB_TYPE_SKIP

#define MB_TYPE_SKIP   (1 << 11)

Definition at line 55 of file mpegutils.h.

◆ MB_TYPE_P0L0

#define MB_TYPE_P0L0   (1 << 12)

Definition at line 56 of file mpegutils.h.

◆ MB_TYPE_P1L0

#define MB_TYPE_P1L0   (1 << 13)

Definition at line 57 of file mpegutils.h.

◆ MB_TYPE_P0L1

#define MB_TYPE_P0L1   (1 << 14)

Definition at line 58 of file mpegutils.h.

◆ MB_TYPE_P1L1

#define MB_TYPE_P1L1   (1 << 15)

Definition at line 59 of file mpegutils.h.

◆ MB_TYPE_L0

#define MB_TYPE_L0   (MB_TYPE_P0L0 | MB_TYPE_P1L0)

Definition at line 60 of file mpegutils.h.

◆ MB_TYPE_L1

#define MB_TYPE_L1   (MB_TYPE_P0L1 | MB_TYPE_P1L1)

Definition at line 61 of file mpegutils.h.

◆ MB_TYPE_L0L1

#define MB_TYPE_L0L1   (MB_TYPE_L0 | MB_TYPE_L1)

Definition at line 62 of file mpegutils.h.

◆ MB_TYPE_QUANT

#define MB_TYPE_QUANT   (1 << 16)

Definition at line 63 of file mpegutils.h.

◆ MB_TYPE_CBP

#define MB_TYPE_CBP   (1 << 17)

Definition at line 64 of file mpegutils.h.

◆ MB_TYPE_INTRA

#define MB_TYPE_INTRA   MB_TYPE_INTRA4x4

Definition at line 66 of file mpegutils.h.

◆ IS_INTRA4x4

#define IS_INTRA4x4 (   a)    ((a) & MB_TYPE_INTRA4x4)

Definition at line 68 of file mpegutils.h.

◆ IS_INTRA16x16

#define IS_INTRA16x16 (   a)    ((a) & MB_TYPE_INTRA16x16)

Definition at line 69 of file mpegutils.h.

◆ IS_PCM

#define IS_PCM (   a)    ((a) & MB_TYPE_INTRA_PCM)

Definition at line 70 of file mpegutils.h.

◆ IS_INTRA

#define IS_INTRA (   a)    ((a) & 7)

Definition at line 71 of file mpegutils.h.

◆ IS_INTER

#define IS_INTER (   a)
Value:

Definition at line 72 of file mpegutils.h.

◆ IS_SKIP

#define IS_SKIP (   a)    ((a) & MB_TYPE_SKIP)

Definition at line 74 of file mpegutils.h.

◆ IS_INTRA_PCM

#define IS_INTRA_PCM (   a)    ((a) & MB_TYPE_INTRA_PCM)

Definition at line 75 of file mpegutils.h.

◆ IS_INTERLACED

#define IS_INTERLACED (   a)    ((a) & MB_TYPE_INTERLACED)

Definition at line 76 of file mpegutils.h.

◆ IS_DIRECT

#define IS_DIRECT (   a)    ((a) & MB_TYPE_DIRECT2)

Definition at line 77 of file mpegutils.h.

◆ IS_GMC

#define IS_GMC (   a)    ((a) & MB_TYPE_GMC)

Definition at line 78 of file mpegutils.h.

◆ IS_16X16

#define IS_16X16 (   a)    ((a) & MB_TYPE_16x16)

Definition at line 79 of file mpegutils.h.

◆ IS_16X8

#define IS_16X8 (   a)    ((a) & MB_TYPE_16x8)

Definition at line 80 of file mpegutils.h.

◆ IS_8X16

#define IS_8X16 (   a)    ((a) & MB_TYPE_8x16)

Definition at line 81 of file mpegutils.h.

◆ IS_8X8

#define IS_8X8 (   a)    ((a) & MB_TYPE_8x8)

Definition at line 82 of file mpegutils.h.

◆ IS_SUB_8X8

#define IS_SUB_8X8 (   a)    ((a) & MB_TYPE_16x16)

Definition at line 83 of file mpegutils.h.

◆ IS_SUB_8X4

#define IS_SUB_8X4 (   a)    ((a) & MB_TYPE_16x8)

Definition at line 84 of file mpegutils.h.

◆ IS_SUB_4X8

#define IS_SUB_4X8 (   a)    ((a) & MB_TYPE_8x16)

Definition at line 85 of file mpegutils.h.

◆ IS_SUB_4X4

#define IS_SUB_4X4 (   a)    ((a) & MB_TYPE_8x8)

Definition at line 86 of file mpegutils.h.

◆ IS_ACPRED

#define IS_ACPRED (   a)    ((a) & MB_TYPE_ACPRED)

Definition at line 87 of file mpegutils.h.

◆ IS_QUANT

#define IS_QUANT (   a)    ((a) & MB_TYPE_QUANT)

Definition at line 88 of file mpegutils.h.

◆ IS_DIR

#define IS_DIR (   a,
  part,
  list 
)    ((a) & (MB_TYPE_P0L0 << ((part) + 2 * (list))))

Definition at line 89 of file mpegutils.h.

◆ USES_LIST

#define USES_LIST (   a,
  list 
)    ((a) & ((MB_TYPE_P0L0 | MB_TYPE_P1L0) << (2 * (list))))

Definition at line 92 of file mpegutils.h.

◆ HAS_CBP

#define HAS_CBP (   a)    ((a) & MB_TYPE_CBP)

Definition at line 94 of file mpegutils.h.

◆ CANDIDATE_MB_TYPE_INTRA

#define CANDIDATE_MB_TYPE_INTRA   (1 << 0)

Definition at line 97 of file mpegutils.h.

◆ CANDIDATE_MB_TYPE_INTER

#define CANDIDATE_MB_TYPE_INTER   (1 << 1)

Definition at line 98 of file mpegutils.h.

◆ CANDIDATE_MB_TYPE_INTER4V

#define CANDIDATE_MB_TYPE_INTER4V   (1 << 2)

Definition at line 99 of file mpegutils.h.

◆ CANDIDATE_MB_TYPE_SKIPPED

#define CANDIDATE_MB_TYPE_SKIPPED   (1 << 3)

Definition at line 100 of file mpegutils.h.

◆ CANDIDATE_MB_TYPE_DIRECT

#define CANDIDATE_MB_TYPE_DIRECT   (1 << 4)

Definition at line 102 of file mpegutils.h.

◆ CANDIDATE_MB_TYPE_FORWARD

#define CANDIDATE_MB_TYPE_FORWARD   (1 << 5)

Definition at line 103 of file mpegutils.h.

◆ CANDIDATE_MB_TYPE_BACKWARD

#define CANDIDATE_MB_TYPE_BACKWARD   (1 << 6)

Definition at line 104 of file mpegutils.h.

◆ CANDIDATE_MB_TYPE_BIDIR

#define CANDIDATE_MB_TYPE_BIDIR   (1 << 7)

Definition at line 105 of file mpegutils.h.

◆ CANDIDATE_MB_TYPE_INTER_I

#define CANDIDATE_MB_TYPE_INTER_I   (1 << 8)

Definition at line 107 of file mpegutils.h.

◆ CANDIDATE_MB_TYPE_FORWARD_I

#define CANDIDATE_MB_TYPE_FORWARD_I   (1 << 9)

Definition at line 108 of file mpegutils.h.

◆ CANDIDATE_MB_TYPE_BACKWARD_I

#define CANDIDATE_MB_TYPE_BACKWARD_I   (1 << 10)

Definition at line 109 of file mpegutils.h.

◆ CANDIDATE_MB_TYPE_BIDIR_I

#define CANDIDATE_MB_TYPE_BIDIR_I   (1 << 11)

Definition at line 110 of file mpegutils.h.

◆ CANDIDATE_MB_TYPE_DIRECT0

#define CANDIDATE_MB_TYPE_DIRECT0   (1 << 12)

Definition at line 112 of file mpegutils.h.

◆ INPLACE_OFFSET

#define INPLACE_OFFSET   16

Definition at line 114 of file mpegutils.h.

Enumeration Type Documentation

◆ OutputFormat

Enumerator
FMT_MPEG1 
FMT_H261 
FMT_H263 
FMT_MJPEG 
FMT_SPEEDHQ 

Definition at line 116 of file mpegutils.h.

Function Documentation

◆ ff_draw_horiz_band()

void ff_draw_horiz_band ( AVCodecContext avctx,
const AVFrame cur,
const AVFrame last,
int  y,
int  h,
int  picture_structure,
int  first_field,
int  low_delay 
)

Draw a horizontal band if supported.

Parameters
his the normal height, this will be reduced automatically if needed

Definition at line 51 of file mpegutils.c.

Referenced by ff_intrax8_decode_picture(), ff_mpeg_draw_horiz_band(), and svq3_decode_frame().

◆ ff_print_debug_info2()

void ff_print_debug_info2 ( AVCodecContext avctx,
AVFrame pict,
const uint8_t *  mbskip_table,
const uint32_t *  mbtype_table,
const int8_t *  qscale_table,
int16_t(*[2])  motion_val[2],
int  mb_width,
int  mb_height,
int  mb_stride,
int  quarter_sample 
)

Print debugging info for the given picture.

Definition at line 157 of file mpegutils.c.

Referenced by ff_print_debug_info(), and finalize_frame().

MB_TYPE_16x8
#define MB_TYPE_16x8
Definition: mpegutils.h:48
MB_TYPE_16x16
#define MB_TYPE_16x16
Definition: mpegutils.h:47
MB_TYPE_8x16
#define MB_TYPE_8x16
Definition: mpegutils.h:49
MB_TYPE_8x8
#define MB_TYPE_8x8
Definition: mpegutils.h:50
a
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
Definition: undefined.txt:41