xine-lib: xine-lib-1.2.12/src/video_dec/libmpeg2/slice.c File Reference

xine-lib 1.2.12

Macros | Functions | Variables
slice.c File Reference
`#include "config.h"`
`#include <inttypes.h>`
`#include <xine/xine_internal.h>`
`#include <xine/video_out.h>`
`#include "mpeg2_internal.h"`
`#include <xine/attributes.h>`
`#include "vlc.h"`

## Macros
#define | bit_buf (picture->bitstream_buf)
#define | bits (picture->bitstream_bits)
#define | bit_ptr (picture->bitstream_ptr)
#define | bit_buf (picture->bitstream_buf)
#define | bits (picture->bitstream_bits)
#define | bit_ptr (picture->bitstream_ptr)
#define | bit_buf (picture->bitstream_buf)
#define | bits (picture->bitstream_bits)
#define | bit_ptr (picture->bitstream_ptr)
#define | bit_buf (picture->bitstream_buf)
#define | bits (picture->bitstream_bits)
#define | bit_ptr (picture->bitstream_ptr)
#define | bit_buf (picture->bitstream_buf)
#define | bits (picture->bitstream_bits)
#define | bit_ptr (picture->bitstream_ptr)
#define | bit_buf (picture->bitstream_buf)
#define | bits (picture->bitstream_bits)
#define | bit_ptr (picture->bitstream_ptr)
#define | bit_buf (picture->bitstream_buf)
#define | bits (picture->bitstream_bits)
#define | bit_ptr (picture->bitstream_ptr)
#define | SATURATE(val)
#define | bit_buf (picture->bitstream_buf)
#define | bits (picture->bitstream_bits)
#define | bit_ptr (picture->bitstream_ptr)
#define | MOTION(table, ref, motion_x, motion_y, size, y)
#define | MOTION_FIELD(table, ref, motion_x, motion_y, dest_field, op, src_field)
#define | bit_buf (picture->bitstream_buf)
#define | bits (picture->bitstream_bits)
#define | bit_ptr (picture->bitstream_ptr)
#define | bit_buf (picture->bitstream_buf)
#define | bits (picture->bitstream_bits)
#define | bit_ptr (picture->bitstream_ptr)
#define | bit_buf (picture->bitstream_buf)
#define | bits (picture->bitstream_bits)
#define | bit_ptr (picture->bitstream_ptr)
#define | bit_buf (picture->bitstream_buf)
#define | bits (picture->bitstream_bits)
#define | bit_ptr (picture->bitstream_ptr)
#define | bit_buf (picture->bitstream_buf)
#define | bits (picture->bitstream_bits)
#define | bit_ptr (picture->bitstream_ptr)
#define | bit_buf (picture->bitstream_buf)
#define | bits (picture->bitstream_bits)
#define | bit_ptr (picture->bitstream_ptr)
#define | bit_buf (picture->bitstream_buf)
#define | bits (picture->bitstream_bits)
#define | bit_ptr (picture->bitstream_ptr)
#define | bit_buf (picture->bitstream_buf)
#define | bits (picture->bitstream_bits)
#define | bit_ptr (picture->bitstream_ptr)
#define | bit_buf (picture->bitstream_buf)
#define | bits (picture->bitstream_bits)
#define | bit_ptr (picture->bitstream_ptr)
#define | MOTION_CALL(routine, direction)
#define | NEXT_MACROBLOCK
#define | bit_buf (picture->bitstream_buf)
#define | bits (picture->bitstream_bits)
#define | bit_ptr (picture->bitstream_ptr)
#define | bit_buf (picture->bitstream_buf)
#define | bits (picture->bitstream_bits)
#define | bit_ptr (picture->bitstream_ptr)

## Functions
static int | get_macroblock_modes (picture_t *picture)
static int | get_quantizer_scale (picture_t *picture)
static int | get_motion_delta (picture_t *picture, int f_code)
static int | bound_motion_vector (int vec, int f_code)
static int | get_dmv (picture_t *picture)
static int | get_coded_block_pattern (picture_t *picture)
static int | get_luma_dc_dct_diff (picture_t *picture)
static int | get_chroma_dc_dct_diff (picture_t *picture)
static void | get_intra_block_B14 (picture_t *picture)
static void | get_intra_block_B15 (picture_t *picture)
static void | get_non_intra_block (picture_t *picture)
static void | get_mpeg1_intra_block (picture_t *picture)
static void | get_mpeg1_non_intra_block (picture_t *picture)
static void | slice_intra_DCT (picture_t *picture, int cc, uint8_t *dest, int stride)
static void | slice_non_intra_DCT (picture_t *picture, uint8_t *dest, int stride)
static void | motion_mp1 (picture_t *picture, motion_t *motion, void(**table)(uint8_t *, uint8_t *, int, int))
static void | motion_fr_frame (picture_t *picture, motion_t *motion, void(**table)(uint8_t *, uint8_t *, int, int))
static void | motion_fr_field (picture_t *picture, motion_t *motion, void(**table)(uint8_t *, uint8_t *, int, int))
static void | motion_fr_dmv (picture_t *picture, motion_t *motion, void(**table)(uint8_t *, uint8_t *, int, int))
static void | motion_reuse (picture_t *picture, motion_t *motion, void(**table)(uint8_t *, uint8_t *, int, int))
static void | motion_zero (picture_t *picture, motion_t *motion, void(**table)(uint8_t *, uint8_t *, int, int))
static void | motion_fr_conceal (picture_t *picture)
static void | motion_fi_field (picture_t *picture, motion_t *motion, void(**table)(uint8_t *, uint8_t *, int, int))
static void | motion_fi_16x8 (picture_t *picture, motion_t *motion, void(**table)(uint8_t *, uint8_t *, int, int))
static void | motion_fi_dmv (picture_t *picture, motion_t *motion, void(**table)(uint8_t *, uint8_t *, int, int))
static void | motion_fi_conceal (picture_t *picture)
static int | slice_init (picture_t *picture, int code)
void | mpeg2_slice (picture_t *picture, int code, uint8_t *buffer)

## Variables
static const int | non_linear_quantizer_scale []

## Macro Definition Documentation

## ◆ bit_buf [1/19]

#define bit_buf (picture->bitstream_buf)

## ◆ bit_buf [2/19]

#define bit_buf (picture->bitstream_buf)

## ◆ bit_buf [3/19]

#define bit_buf (picture->bitstream_buf)

## ◆ bit_buf [4/19]

#define bit_buf (picture->bitstream_buf)

## ◆ bit_buf [5/19]

#define bit_buf (picture->bitstream_buf)

## ◆ bit_buf [6/19]

#define bit_buf (picture->bitstream_buf)

## ◆ bit_buf [7/19]

#define bit_buf (picture->bitstream_buf)

## ◆ bit_buf [8/19]

#define bit_buf (picture->bitstream_buf)

## ◆ bit_buf [9/19]

#define bit_buf (picture->bitstream_buf)

## ◆ bit_buf [10/19]

#define bit_buf (picture->bitstream_buf)

## ◆ bit_buf [11/19]

#define bit_buf (picture->bitstream_buf)

## ◆ bit_buf [12/19]

#define bit_buf (picture->bitstream_buf)

## ◆ bit_buf [13/19]

#define bit_buf (picture->bitstream_buf)

## ◆ bit_buf [14/19]

#define bit_buf (picture->bitstream_buf)

## ◆ bit_buf [15/19]

#define bit_buf (picture->bitstream_buf)

## ◆ bit_buf [16/19]

#define bit_buf (picture->bitstream_buf)

## ◆ bit_buf [17/19]

#define bit_buf (picture->bitstream_buf)

## ◆ bit_buf [18/19]

#define bit_buf (picture->bitstream_buf)

## ◆ bit_buf [19/19]

#define bit_buf (picture->bitstream_buf)

## ◆ bit_ptr [1/19]

#define bit_ptr (picture->bitstream_ptr)

## ◆ bit_ptr [2/19]

#define bit_ptr (picture->bitstream_ptr)

## ◆ bit_ptr [3/19]

#define bit_ptr (picture->bitstream_ptr)

## ◆ bit_ptr [4/19]

#define bit_ptr (picture->bitstream_ptr)

## ◆ bit_ptr [5/19]

#define bit_ptr (picture->bitstream_ptr)

## ◆ bit_ptr [6/19]

#define bit_ptr (picture->bitstream_ptr)

## ◆ bit_ptr [7/19]

#define bit_ptr (picture->bitstream_ptr)

## ◆ bit_ptr [8/19]

#define bit_ptr (picture->bitstream_ptr)

## ◆ bit_ptr [9/19]

#define bit_ptr (picture->bitstream_ptr)

## ◆ bit_ptr [10/19]

#define bit_ptr (picture->bitstream_ptr)

## ◆ bit_ptr [11/19]

#define bit_ptr (picture->bitstream_ptr)

## ◆ bit_ptr [12/19]

#define bit_ptr (picture->bitstream_ptr)

## ◆ bit_ptr [13/19]

#define bit_ptr (picture->bitstream_ptr)

## ◆ bit_ptr [14/19]

#define bit_ptr (picture->bitstream_ptr)

## ◆ bit_ptr [15/19]

#define bit_ptr (picture->bitstream_ptr)

## ◆ bit_ptr [16/19]

#define bit_ptr (picture->bitstream_ptr)

## ◆ bit_ptr [17/19]

#define bit_ptr (picture->bitstream_ptr)

## ◆ bit_ptr [18/19]

#define bit_ptr (picture->bitstream_ptr)

## ◆ bit_ptr [19/19]

#define bit_ptr (picture->bitstream_ptr)

## ◆ bits [1/19]

#define bits (picture->bitstream_bits)

## ◆ bits [2/19]

#define bits (picture->bitstream_bits)

## ◆ bits [3/19]

#define bits (picture->bitstream_bits)

## ◆ bits [4/19]

#define bits (picture->bitstream_bits)

## ◆ bits [5/19]

#define bits (picture->bitstream_bits)

## ◆ bits [6/19]

#define bits (picture->bitstream_bits)

## ◆ bits [7/19]

#define bits (picture->bitstream_bits)

## ◆ bits [8/19]

#define bits (picture->bitstream_bits)

## ◆ bits [9/19]

#define bits (picture->bitstream_bits)

## ◆ bits [10/19]

#define bits (picture->bitstream_bits)

## ◆ bits [11/19]

#define bits (picture->bitstream_bits)

## ◆ bits [12/19]

#define bits (picture->bitstream_bits)

## ◆ bits [13/19]

#define bits (picture->bitstream_bits)

## ◆ bits [14/19]

#define bits (picture->bitstream_bits)

## ◆ bits [15/19]

#define bits (picture->bitstream_bits)

## ◆ bits [16/19]

#define bits (picture->bitstream_bits)

## ◆ bits [17/19]

#define bits (picture->bitstream_bits)

## ◆ bits [18/19]

#define bits (picture->bitstream_bits)

## ◆ bits [19/19]

#define bits (picture->bitstream_bits)

## ◆ MOTION

#define MOTION | ( |  | table,
|  |  | ref,
|  |  | motion_x,
|  |  | motion_y,
|  |  | size,
|  |  | y
| ) |  |

Value:
pos_x = 2 * picture->offset + motion_x; \
pos_y = 2 * picture->v_offset + motion_y + 2 * y; \
if (pos_x > picture->limit_x) { \
pos_x = ((int)pos_x < 0) ? 0 : picture->limit_x; \
motion_x = pos_x - 2 * picture->offset; \
} \
if (pos_y > picture->limit_y_ ## size){ \
pos_y = ((int)pos_y < 0) ? 0 : picture->limit_y_ ## size; \
motion_y = pos_y - 2 * picture->v_offset - 2 * y; \
} \
xy_half = ((pos_y & 1) << 1) | (pos_x & 1); \
table[xy_half] (picture->dest[0] + y * picture->pitches[0] + \
picture->offset, ref[0] + (pos_x >> 1) + \
(pos_y >> 1) * picture->pitches[0], picture->pitches[0], \
size); \
motion_x /= 2; motion_y /= 2; \
xy_half = ((motion_y & 1) << 1) | (motion_x & 1); \
table[4+xy_half] (picture->dest[1] + y/2 * picture->pitches[1] + \
(picture->offset >> 1), ref[1] + \
(((picture->offset + motion_x) >> 1) + \
((((picture->v_offset + motion_y) >> 1) + y/2) * \
picture->pitches[1])), picture->pitches[1], size/2); \
table[4+xy_half] (picture->dest[2] + y/2 * picture->pitches[2] + \
(picture->offset >> 1), ref[2] + \
(((picture->offset + motion_x) >> 1) + \
((((picture->v_offset + motion_y) >> 1) + y/2) * \
picture->pitches[2])), picture->pitches[2], size/2) \

## ◆ MOTION_CALL

#define MOTION_CALL | ( |  | routine,
|  |  | direction
| ) |  |

Value:
do { \
if ((direction) & MACROBLOCK_MOTION_FORWARD) \
routine (picture, &(picture->f_motion), mpeg2_mc.put); \
if ((direction) & MACROBLOCK_MOTION_BACKWARD) \
routine (picture, &(picture->b_motion), \
((direction) & MACROBLOCK_MOTION_FORWARD ? \
mpeg2_mc.avg : mpeg2_mc.put)); \
} while (0)
mpeg2_mc
mpeg2_mc_t mpeg2_mc
Definition: motion_comp.c:32
MACROBLOCK_MOTION_BACKWARD
#define MACROBLOCK_MOTION_BACKWARD
Definition: mpeg2_internal.h:37
MACROBLOCK_MOTION_FORWARD
#define MACROBLOCK_MOTION_FORWARD
Definition: mpeg2_internal.h:38
mpeg2_mc_t::avg
mpeg2_mc_fct * avg[8]
Definition: mpeg2_internal.h:286
mpeg2_mc_t::put
mpeg2_mc_fct * put[8]
Definition: mpeg2_internal.h:285

## ◆ MOTION_FIELD

#define MOTION_FIELD | ( |  | table,
|  |  | ref,
|  |  | motion_x,
|  |  | motion_y,
|  |  | dest_field,
|  |  | op,
|  |  | src_field
| ) |  |

Value:
pos_x = 2 * picture->offset + motion_x; \
pos_y = picture->v_offset + motion_y; \
if (pos_x > picture->limit_x) { \
pos_x = ((int)pos_x < 0) ? 0 : picture->limit_x; \
motion_x = pos_x - 2 * picture->offset; \
} \
if (pos_y > picture->limit_y){ \
pos_y = ((int)pos_y < 0) ? 0 : picture->limit_y; \
motion_y = pos_y - picture->v_offset; \
} \
xy_half = ((pos_y & 1) << 1) | (pos_x & 1); \
table[xy_half] (picture->dest[0] + dest_field * picture->pitches[0] + \
picture->offset, \
(ref[0] + (pos_x >> 1) + \
((pos_y op) + src_field) * picture->pitches[0]), \
2 * picture->pitches[0], 8); \
motion_x /= 2; motion_y /= 2; \
xy_half = ((motion_y & 1) << 1) | (motion_x & 1); \
table[4+xy_half] (picture->dest[1] + dest_field * picture->pitches[1] + \
(picture->offset >> 1), ref[1] + \
(((picture->offset + motion_x) >> 1) + \
(((picture->v_offset >> 1) + \
(motion_y op) + src_field) * picture->pitches[1])), \
2 * picture->pitches[1], 4); \
table[4+xy_half] (picture->dest[2] + dest_field * picture->pitches[2] + \
(picture->offset >> 1), ref[2] + \
(((picture->offset + motion_x) >> 1) + \
(((picture->v_offset >> 1) + \
(motion_y op) + src_field) * picture->pitches[2])), \
2 * picture->pitches[2], 4)

## ◆ NEXT_MACROBLOCK

#define NEXT_MACROBLOCK

Value:
do { \
picture->offset += 16; \
if (picture->offset == picture->coded_picture_width) { \
do { /* just so we can use the break statement */ \
if (picture->current_frame->proc_slice) { \
picture->current_frame->proc_slice (picture->current_frame, \
picture->dest); \
} \
picture->dest[0] += 16 * picture->pitches[0]; \
picture->dest[1] += 8 * picture->pitches[1]; \
picture->dest[2] += 8 * picture->pitches[2]; \
} while (0); \
picture->v_offset += 16; \
if (picture->v_offset > picture->limit_y) { \
if (mpeg2_cpu_state_restore) \
mpeg2_cpu_state_restore (&cpu_state); \
return; \
} \
picture->offset = 0; \
} \
} while (0)
mpeg2_cpu_state_restore
void(* mpeg2_cpu_state_restore)(cpu_state_t *state)
Definition: cpu_state.c:34

## ◆ SATURATE

#define SATURATE | ( |  | val | ) |

Value:
do { \
if ((uint32_t)(val + 2048) > 4095) \
val = (val > 0) ? 2047 : -2048; \
} while (0)

## Function Documentation

## ◆ bound_motion_vector()

static int bound_motion_vector | ( | int | vec,
|  | int | f_code
| ) |  |
| inlinestatic

Referenced by motion_fi_16x8(), motion_fi_conceal(), motion_fi_dmv(), motion_fi_field(), motion_fr_conceal(), motion_fr_dmv(), motion_fr_field(), motion_fr_frame(), and motion_mp1().

## ◆ get_chroma_dc_dct_diff()

static int get_chroma_dc_dct_diff | ( | picture_t * | picture | ) |
| inlinestatic

References bit_buf, bit_ptr, bits, DC_chrom_5, DC_long, DUMPBITS, DCtab::len, NEEDBITS, SBITS, DCtab::size, and UBITS.

Referenced by slice_intra_DCT().

## ◆ get_coded_block_pattern()

static int get_coded_block_pattern | ( | picture_t * | picture | ) |
| inlinestatic

References bit_buf, bit_ptr, bits, CBPtab::cbp, CBP_7, CBP_9, DUMPBITS, CBPtab::len, NEEDBITS, and UBITS.

Referenced by mpeg2_slice().

## ◆ get_dmv()

static int get_dmv | ( | picture_t * | picture | ) |
| inlinestatic

References bit_buf, bits, DMVtab::dmv, DMV_2, DUMPBITS, DMVtab::len, and UBITS.

Referenced by motion_fi_dmv(), and motion_fr_dmv().

## ◆ get_intra_block_B14()

static void get_intra_block_B14 | ( | picture_t * | picture | ) |
| static

References bit_buf, bit_ptr, bits, DCT_13, DCT_15, DCT_16, DCT_B14_10, DCT_B14_8, DCT_B14AC_5, DUMPBITS, GETWORD, DCTtab::len, DCTtab::level, NEEDBITS, DCTtab::run, SATURATE, SBITS, and UBITS.

Referenced by slice_intra_DCT().

## ◆ get_intra_block_B15()

static void get_intra_block_B15 | ( | picture_t * | picture | ) |
| static

References bit_buf, bit_ptr, bits, DCT_13, DCT_15, DCT_16, DCT_B15_10, DCT_B15_8, DUMPBITS, GETWORD, DCTtab::len, DCTtab::level, NEEDBITS, DCTtab::run, SATURATE, SBITS, and UBITS.

Referenced by slice_intra_DCT().

## ◆ get_luma_dc_dct_diff()

static int get_luma_dc_dct_diff | ( | picture_t * | picture | ) |
| inlinestatic

References bit_buf, bit_ptr, bits, DC_long, DC_lum_5, DUMPBITS, DCtab::len, NEEDBITS, SBITS, DCtab::size, and UBITS.

Referenced by slice_intra_DCT().

## ◆ get_macroblock_modes()

static int get_macroblock_modes | ( | picture_t * | picture | ) |
| inlinestatic

References B_TYPE, bit_buf, bits, D_TYPE, DCT_TYPE_INTERLACED, DUMPBITS, FRAME_PICTURE, I_TYPE, MBtab::len, MACROBLOCK_INTRA, MACROBLOCK_MOTION_FORWARD, MACROBLOCK_PATTERN, MB_B, MB_I, MB_P, MC_FRAME, MBtab::modes, MOTION_TYPE_BASE, P_TYPE, and UBITS.

Referenced by mpeg2_slice().

## ◆ get_motion_delta()

static int get_motion_delta | ( | picture_t * | picture,
|  | int | f_code
| ) |  |
| inlinestatic

References bit_buf, bit_ptr, bits, MVtab::delta, DUMPBITS, MVtab::len, MV_10, MV_4, NEEDBITS, SBITS, and UBITS.

Referenced by motion_fi_16x8(), motion_fi_conceal(), motion_fi_dmv(), motion_fi_field(), motion_fr_conceal(), motion_fr_dmv(), motion_fr_field(), motion_fr_frame(), and motion_mp1().

## ◆ get_mpeg1_intra_block()

static void get_mpeg1_intra_block | ( | picture_t * | picture | ) |
| static

References bit_buf, bit_ptr, bits, DCT_13, DCT_15, DCT_16, DCT_B14_10, DCT_B14_8, DCT_B14AC_5, DUMPBITS, GETWORD, DCTtab::len, DCTtab::level, NEEDBITS, DCTtab::run, SATURATE, SBITS, and UBITS.

Referenced by slice_intra_DCT().

## ◆ get_mpeg1_non_intra_block()

static void get_mpeg1_non_intra_block | ( | picture_t * | picture | ) |
| static

References bit_buf, bit_ptr, bits, DCT_13, DCT_15, DCT_16, DCT_B14_10, DCT_B14_8, DCT_B14AC_5, DCT_B14DC_5, DUMPBITS, GETWORD, DCTtab::len, DCTtab::level, NEEDBITS, DCTtab::run, SATURATE, SBITS, and UBITS.

Referenced by slice_non_intra_DCT().

## ◆ get_non_intra_block()

static void get_non_intra_block | ( | picture_t * | picture | ) |
| static

References bit_buf, bit_ptr, bits, DCT_13, DCT_15, DCT_16, DCT_B14_10, DCT_B14_8, DCT_B14AC_5, DCT_B14DC_5, DUMPBITS, GETWORD, DCTtab::len, DCTtab::level, NEEDBITS, DCTtab::run, SATURATE, SBITS, and UBITS.

Referenced by slice_non_intra_DCT().

## ◆ get_quantizer_scale()

static int get_quantizer_scale | ( | picture_t * | picture | ) |
| inlinestatic

References bit_buf, bits, DUMPBITS, non_linear_quantizer_scale, and UBITS.

Referenced by mpeg2_slice(), and slice_init().

## ◆ motion_fi_16x8()

static void motion_fi_16x8 | ( | picture_t * | picture,
|  | motion_t * | motion,
|  | void(**)(uint8_t *, uint8_t *, int, int) | table
| ) |  |
| static

References bit_buf, bit_ptr, bits, bound_motion_vector(), DUMPBITS, motion_t::f_code, get_motion_delta(), MOTION, NEEDBITS, motion_t::pmv, motion_t::ref2, and UBITS.

Referenced by mpeg2_slice().

## ◆ motion_fi_conceal()

static void motion_fi_conceal | ( | picture_t * | picture | ) |
| static

References bit_buf, bit_ptr, bits, bound_motion_vector(), DUMPBITS, get_motion_delta(), and NEEDBITS.

Referenced by mpeg2_slice().

## ◆ motion_fi_dmv()

static void motion_fi_dmv | ( | picture_t * | picture,
|  | motion_t * | motion,
|  | void(**)(uint8_t *, uint8_t *, int, int) | table
| ) |  |
| static

References mpeg2_mc_t::avg, bit_buf, bit_ptr, bits, bound_motion_vector(), motion_t::f_code, get_dmv(), get_motion_delta(), MOTION, mpeg2_mc, NEEDBITS, motion_t::pmv, mpeg2_mc_t::put, and motion_t::ref.

Referenced by mpeg2_slice().

## ◆ motion_fi_field()

static void motion_fi_field | ( | picture_t * | picture,
|  | motion_t * | motion,
|  | void(**)(uint8_t *, uint8_t *, int, int) | table
| ) |  |
| static

References bit_buf, bit_ptr, bits, bound_motion_vector(), DUMPBITS, motion_t::f_code, get_motion_delta(), MOTION, NEEDBITS, motion_t::pmv, motion_t::ref2, and UBITS.

Referenced by mpeg2_slice().

## ◆ motion_fr_conceal()

static void motion_fr_conceal | ( | picture_t * | picture | ) |
| static

References bit_buf, bit_ptr, bits, bound_motion_vector(), DUMPBITS, get_motion_delta(), and NEEDBITS.

Referenced by mpeg2_slice().

## ◆ motion_fr_dmv()

static void motion_fr_dmv | ( | picture_t * | picture,
|  | motion_t * | motion,
|  | void(**)(uint8_t *, uint8_t *, int, int) | table
| ) |  |
| static

References mpeg2_mc_t::avg, bit_buf, bit_ptr, bits, bound_motion_vector(), motion_t::f_code, get_dmv(), get_motion_delta(), MOTION_FIELD, mpeg2_mc, NEEDBITS, motion_t::pmv, mpeg2_mc_t::put, motion_t::ref, and picture_t::top_field_first.

Referenced by mpeg2_slice().

## ◆ motion_fr_field()

static void motion_fr_field | ( | picture_t * | picture,
|  | motion_t * | motion,
|  | void(**)(uint8_t *, uint8_t *, int, int) | table
| ) |  |
| static

References bit_buf, bit_ptr, bits, bound_motion_vector(), DUMPBITS, motion_t::f_code, field, get_motion_delta(), MOTION_FIELD, NEEDBITS, motion_t::pmv, motion_t::ref, and UBITS.

Referenced by mpeg2_slice().

## ◆ motion_fr_frame()

static void motion_fr_frame | ( | picture_t * | picture,
|  | motion_t * | motion,
|  | void(**)(uint8_t *, uint8_t *, int, int) | table
| ) |  |
| static

References bit_buf, bit_ptr, bits, bound_motion_vector(), motion_t::f_code, get_motion_delta(), MOTION, NEEDBITS, motion_t::pmv, and motion_t::ref.

Referenced by mpeg2_slice().

## ◆ motion_mp1()

static void motion_mp1 | ( | picture_t * | picture,
|  | motion_t * | motion,
|  | void(**)(uint8_t *, uint8_t *, int, int) | table
| ) |  |
| static

References bit_buf, bit_ptr, bits, bound_motion_vector(), motion_t::f_code, get_motion_delta(), MOTION, NEEDBITS, motion_t::pmv, and motion_t::ref.

Referenced by mpeg2_init_fbuf(), and mpeg2_slice().

## ◆ motion_reuse()

static void motion_reuse | ( | picture_t * | picture,
|  | motion_t * | motion,
|  | void(**)(uint8_t *, uint8_t *, int, int) | table
| ) |  |
| static

References MOTION, motion_t::pmv, and motion_t::ref.

Referenced by mpeg2_slice().

## ◆ motion_zero()

static void motion_zero | ( | picture_t * | picture,
|  | motion_t * | motion,
|  | void(**)(uint8_t *, uint8_t *, int, int) | table
| ) |  |
| static

References motion_t::ref.

Referenced by mpeg2_slice().

## ◆ mpeg2_slice()

void mpeg2_slice | ( | picture_t * | picture,
|  | int | code,
|  | uint8_t * | buffer
| ) |  |

References bit_buf, bit_ptr, bits, bitstream_init(), code, D_TYPE, DCT_TYPE_INTERLACED, DUMPBITS, FRAME_PICTURE, get_coded_block_pattern(), get_macroblock_modes(), get_quantizer_scale(), MBAtab::len, MACROBLOCK_INTRA, MACROBLOCK_MOTION_FORWARD, MACROBLOCK_PATTERN, MACROBLOCK_QUANT, MBAtab::mba, MBA_11, MBA_5, MC_16X8, MC_DMV, MC_FIELD, MC_FRAME, MOTION_CALL, motion_fi_16x8(), motion_fi_conceal(), motion_fi_dmv(), motion_fi_field(), motion_fr_conceal(), motion_fr_dmv(), motion_fr_field(), motion_fr_frame(), motion_mp1(), motion_reuse(), MOTION_TYPE_MASK, motion_zero(), mpeg2_cpu_state_restore, mpeg2_cpu_state_save, NEEDBITS, NEXT_MACROBLOCK, P_TYPE, slice_init(), slice_intra_DCT(), slice_non_intra_DCT(), and UBITS.

Referenced by libmpeg2_accel_slice(), and mpeg2_parse().

## ◆ slice_init()

static int slice_init | ( | picture_t * | picture,
|  | int | code
| ) |  |
| inlinestatic

References B_TYPE, vo_frame_s::base, bit_buf, bit_ptr, bits, BOTTOM_FIELD, code, DUMPBITS, FRAME_PICTURE, get_quantizer_scale(), height, MBAtab::len, MBAtab::mba, MBA_11, MBA_5, NEEDBITS, NULL, TOP_FIELD, and UBITS.

Referenced by mpeg2_slice().

## ◆ slice_intra_DCT()

static void slice_intra_DCT | ( | picture_t * | picture,
|  | int | cc,
|  | uint8_t * | dest,
|  | int | stride
| ) |  |
| inlinestatic

References bit_buf, bit_ptr, bits, D_TYPE, get_chroma_dc_dct_diff(), get_intra_block_B14(), get_intra_block_B15(), get_luma_dc_dct_diff(), get_mpeg1_intra_block(), mpeg2_idct_copy, and NEEDBITS.

Referenced by mpeg2_slice().

## ◆ slice_non_intra_DCT()

static void slice_non_intra_DCT | ( | picture_t * | picture,
|  | uint8_t * | dest,
|  | int | stride
| ) |  |
| inlinestatic

References get_mpeg1_non_intra_block(), get_non_intra_block(), and mpeg2_idct_add.

Referenced by mpeg2_slice().

## Variable Documentation

## ◆ non_linear_quantizer_scale

const int non_linear_quantizer_scale[]
| static

Initial value:
= {
0, 1, 2, 3, 4, 5, 6, 7,
8, 10, 12, 14, 16, 18, 20, 22,
24, 28, 32, 36, 40, 44, 48, 52,
56, 64, 72, 80, 88, 96, 104, 112
}

Referenced by get_quantizer_scale().