xine-lib 1.2.13-20230125hg15249
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) \

Referenced by motion_fi_16x8(), motion_fi_dmv(), motion_fi_field(), motion_fr_frame(), motion_mp1(), and motion_reuse().

◆ 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 ? \
} while (0)
#define put(predictor, i)
Definition motion_comp.c:96
mpeg2_mc_t mpeg2_mc
Definition motion_comp.c:32
#define MACROBLOCK_MOTION_BACKWARD
Definition mpeg2_internal.h:37
#define MACROBLOCK_MOTION_FORWARD
Definition mpeg2_internal.h:38
mpeg2_mc_fct * avg[8]
Definition mpeg2_internal.h:286
mpeg2_mc_fct * put[8]
Definition mpeg2_internal.h:285

Referenced by mpeg2_slice(), and mpeg2_slice().

◆ 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)

Referenced by motion_fr_dmv(), and motion_fr_field().

◆ 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) { \
mpeg2_cpu_state_restore (&cpu_state); \
return; \
} \
picture->offset = 0; \
} \
} while (0)
void(* mpeg2_cpu_state_restore)(cpu_state_t *state)
Definition cpu_state.c:34

Referenced by mpeg2_slice(), and mpeg2_slice().

◆ SATURATE

#define SATURATE ( val)

Function Documentation

◆ bound_motion_vector()

static int bound_motion_vector ( int vec,
int f_code )
inlinestatic

◆ get_chroma_dc_dct_diff()

static int get_chroma_dc_dct_diff ( picture_t * picture)
inlinestatic

◆ get_coded_block_pattern()

static int get_coded_block_pattern ( picture_t * picture)
inlinestatic

◆ get_dmv()

static int get_dmv ( picture_t * picture)
inlinestatic

◆ get_intra_block_B14()

static void get_intra_block_B14 ( picture_t * picture)
static

◆ get_intra_block_B15()

static void get_intra_block_B15 ( picture_t * picture)
static

◆ get_luma_dc_dct_diff()

static int get_luma_dc_dct_diff ( picture_t * picture)
inlinestatic

◆ get_macroblock_modes()

static int get_macroblock_modes ( picture_t * picture)
inlinestatic

◆ get_motion_delta()

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

◆ get_mpeg1_intra_block()

static void get_mpeg1_intra_block ( picture_t * picture)
static

◆ get_mpeg1_non_intra_block()

static void get_mpeg1_non_intra_block ( picture_t * picture)
static

◆ get_non_intra_block()

static void get_non_intra_block ( picture_t * picture)
static

◆ get_quantizer_scale()

static int get_quantizer_scale ( picture_t * picture)
inlinestatic

◆ motion_fi_16x8()

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

◆ motion_fi_conceal()

static void motion_fi_conceal ( picture_t * picture)
static

◆ motion_fi_dmv()

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

◆ motion_fi_field()

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

◆ motion_fr_conceal()

static void motion_fr_conceal ( picture_t * picture)
static

◆ motion_fr_dmv()

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

◆ motion_fr_field()

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

◆ motion_fr_frame()

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

◆ motion_mp1()

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

◆ 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 )

◆ slice_init()

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

◆ slice_intra_DCT()

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

◆ slice_non_intra_DCT()

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

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().