xine-lib 1.2.11
Macros | Functions | Variables
alterh264_decode.c File Reference
#include "alterh264_decode.h"
#include "group_vdpau.h"

Macros

#define MAX_DPB_SIZE   16
 
#define MIN_BUFFER_SIZE   10000
 
#define MAX_BUFFER_SIZE   3145728
 
#define NAL_UNSPECIFIED   0
 
#define NAL_SLICE_NO_IDR   1
 
#define NAL_SLICE_IDR   5
 
#define NAL_SEI   6
 
#define NAL_SEQUENCE   7
 
#define NAL_PICTURE   8
 
#define NAL_ACCES   9
 
#define NAL_END_SEQUENCE   10
 
#define NAL_END_STREAM   11
 
#define NAL_SEQUENCE_EXT   13
 
#define SLICE_TYPE_P   0
 
#define SLICE_TYPE_B   1
 
#define SLICE_TYPE_I   2
 
#define SLICE_TYPE_SP   3
 
#define SLICE_TYPE_SI   4
 
#define START_IDR_FLAG   1000
 
#define MAX_POC   2147483647
 
#define DPB_DRAW_CLEAR   1
 
#define DPB_DRAW_REFS   2
 
#define DPB_DRAW_CURRENT   3
 

Functions

static void dpb_print (sequence_t *sequence)
 
static void dpb_clear_all_pts (sequence_t *sequence)
 
static void dpb_reset (sequence_t *sequence)
 
static void dpb_remove (sequence_t *sequence, int index)
 
static dpb_frame_tdpb_get_prev_ref (sequence_t *sequence)
 
static void dpb_draw_frames (vdpau_h264_alter_decoder_t *this_gen, int32_t curpoc, int draw_mode)
 
static dpb_frame_tdpb_get_PicNum (sequence_t *sequence, int32_t pic_num, int *index)
 
static void dpb_mmc1 (vdpau_h264_alter_decoder_t *this_gen, int32_t picnum)
 
static void dbp_append (vdpau_h264_alter_decoder_t *this_gen, int second_field)
 
static void reset_slices (sequence_t *sequence)
 
static void reset_sequence (sequence_t *sequence)
 
static void set_ratio (sequence_t *seq, seq_param_t *sp)
 
static void parse_scaling_list (bits_reader_t *br, uint8_t *scaling_list, int len, int index)
 
static void scaling_list_fallback_A (uint8_t *scaling_lists_4x4, uint8_t *scaling_lists_8x8, int i)
 
static void scaling_list_fallback_B (seq_param_t *sp, pic_param_t *pic, int i)
 
static void vui_parameters (sequence_t *seq, vui_param_t *vui)
 
static void seq_parameter_set_data (vdpau_h264_alter_decoder_t *this_gen)
 
static void pic_parameter_set (vdpau_h264_alter_decoder_t *this_gen)
 
static void pred_weight_table (vdpau_h264_alter_decoder_t *this_gen, uint8_t slice_type, uint8_t ChromaArrayType, uint8_t l0, uint8_t l1)
 
static void ref_pic_list_reordering (vdpau_h264_alter_decoder_t *this_gen)
 
static void dec_ref_pic_marking (vdpau_h264_alter_decoder_t *this_gen, uint8_t idr)
 
static void slice_header (vdpau_h264_alter_decoder_t *this_gen, uint8_t nal_ref_idc, uint8_t nal_unit_type)
 
static void slice_header_post (vdpau_h264_alter_decoder_t *this_gen)
 
static void decode_poc (vdpau_h264_alter_decoder_t *this_gen)
 
static void decode_picnum (vdpau_h264_alter_decoder_t *this_gen)
 
static int check_ref_list (vdpau_h264_alter_decoder_t *this_gen)
 
static void decode_render (vdpau_h264_alter_decoder_t *vd, int bad_frame)
 
static void decode_picture (vdpau_h264_alter_decoder_t *decoder)
 
static int parse_startcodes (vdpau_h264_alter_decoder_t *this_gen, uint8_t *buf, uint32_t len)
 
static void parse_codec_private (vdpau_h264_alter_decoder_t *this_gen, const uint8_t *buf, uint32_t len)
 
static void flush_buffer (sequence_t *seq)
 
static void vdpau_h264_alter_decode_data (video_decoder_t *this_gen, buf_element_t *buf)
 
static void vdpau_h264_alter_flush (video_decoder_t *this_gen)
 
static void vdpau_h264_alter_reset (video_decoder_t *this_gen)
 
static void vdpau_h264_alter_discontinuity (video_decoder_t *this_gen)
 
static void vdpau_h264_alter_dispose (video_decoder_t *this_gen)
 
static video_decoder_topen_plugin (video_decoder_class_t *class_gen, xine_stream_t *stream)
 
void * h264_alter_init_plugin (xine_t *xine, const void *data)
 

Variables

static const uint8_t zigzag_4x4 [16]
 
static const uint8_t zigzag_8x8 [64]
 
static const uint8_t default_4x4_intra [16]
 
static const uint8_t default_4x4_inter [16]
 
static const uint8_t default_8x8_intra [64]
 
static const uint8_t default_8x8_inter [64]
 

Macro Definition Documentation

◆ DPB_DRAW_CLEAR

#define DPB_DRAW_CLEAR   1

◆ DPB_DRAW_CURRENT

#define DPB_DRAW_CURRENT   3

◆ DPB_DRAW_REFS

#define DPB_DRAW_REFS   2

◆ MAX_BUFFER_SIZE

#define MAX_BUFFER_SIZE   3145728

◆ MAX_DPB_SIZE

#define MAX_DPB_SIZE   16

◆ MAX_POC

#define MAX_POC   2147483647

◆ MIN_BUFFER_SIZE

#define MIN_BUFFER_SIZE   10000

◆ NAL_ACCES

#define NAL_ACCES   9

◆ NAL_END_SEQUENCE

#define NAL_END_SEQUENCE   10

◆ NAL_END_STREAM

#define NAL_END_STREAM   11

◆ NAL_PICTURE

#define NAL_PICTURE   8

◆ NAL_SEI

#define NAL_SEI   6

◆ NAL_SEQUENCE

#define NAL_SEQUENCE   7

◆ NAL_SEQUENCE_EXT

#define NAL_SEQUENCE_EXT   13

◆ NAL_SLICE_IDR

#define NAL_SLICE_IDR   5

◆ NAL_SLICE_NO_IDR

#define NAL_SLICE_NO_IDR   1

◆ NAL_UNSPECIFIED

#define NAL_UNSPECIFIED   0

◆ SLICE_TYPE_B

#define SLICE_TYPE_B   1

◆ SLICE_TYPE_I

#define SLICE_TYPE_I   2

◆ SLICE_TYPE_P

#define SLICE_TYPE_P   0

◆ SLICE_TYPE_SI

#define SLICE_TYPE_SI   4

◆ SLICE_TYPE_SP

#define SLICE_TYPE_SP   3

◆ START_IDR_FLAG

#define START_IDR_FLAG   1000

Function Documentation

◆ check_ref_list()

static int check_ref_list ( vdpau_h264_alter_decoder_t this_gen)
static

◆ dbp_append()

static void dbp_append ( vdpau_h264_alter_decoder_t this_gen,
int  second_field 
)
static

◆ dec_ref_pic_marking()

static void dec_ref_pic_marking ( vdpau_h264_alter_decoder_t this_gen,
uint8_t  idr 
)
static

◆ decode_picnum()

static void decode_picnum ( vdpau_h264_alter_decoder_t this_gen)
static

◆ decode_picture()

static void decode_picture ( vdpau_h264_alter_decoder_t decoder)
static

◆ decode_poc()

static void decode_poc ( vdpau_h264_alter_decoder_t this_gen)
static

◆ decode_render()

static void decode_render ( vdpau_h264_alter_decoder_t vd,
int  bad_frame 
)
static

References _x_meta_info_set_utf8(), _x_stream_info_set(), vo_frame_s::accel_data, sequence_t::accel_vdpau, xine_format_change_data_t::aspect, slice_param_t::bottom_field_flag, dpb_frame_t::BottomFieldOrderCnt, sequence_t::buf, slice_t::buf_offset, CAST_VdpPictureInfo_PTR, sequence_t::chroma, pic_param_t::chroma_qp_index_offset, sequence_t::coded_height, sequence_t::coded_width, sequence_t::color_matrix, dpb_frame_t::completed, pic_param_t::constrained_intra_pred_flag, sequence_t::cur_pic, vdpau_accel_t::current_vdp_runtime_nr, pic_param_t::deblocking_filter_control_present_flag, vdpau_mpeg12_decoder_s::decoder, vdpau_mpeg12_decoder_s::decoder_height, vdpau_mpeg12_decoder_s::decoder_profile, vdpau_mpeg12_decoder_s::decoder_width, seq_param_t::delta_pic_order_always_zero_flag, seq_param_t::direct_8x8_inference_flag, sequence_t::dpb, dpb_frame_t::drop_pts, pic_param_t::entropy_coding_mode_flag, slice_param_t::field_pic_flag, dpb_frame_t::field_pic_flag, seq_param_t::frame_mbs_only_flag, slice_param_t::frame_num, dpb_frame_t::FrameNum, xine_video_port_s::get_frame, xine_format_change_data_t::height, dpb_frame_t::is_reference, slice_t::len, vdpau_accel_t::lock, seq_param_t::log2_max_frame_num_minus4, seq_param_t::log2_max_pic_order_cnt_lsb_minus4, lprintf, MAX_DPB_SIZE, seq_param_t::mb_adaptive_frame_field_flag, slice_param_t::nal_ref_idc, seq_param_t::num_ref_frames, pic_param_t::num_ref_idx_l0_active_minus1, pic_param_t::num_ref_idx_l1_active_minus1, pic_param_t::pic_init_qp_minus26, seq_param_t::pic_order_cnt_type, pic_param_t::pic_order_present_flag, sequence_t::pic_param, slice_param_t::pic_parameter_set_id, sequence_t::pic_pts, pic_param_t::pic_scaling_matrix_present_flag, PICTURE_DONE, sequence_t::profile, dpb_frame_t::pts, sequence_t::ratio, pic_param_t::redundant_pic_cnt_present_flag, sequence_t::reported_coded_height, sequence_t::reported_coded_width, sequence_t::reported_ratio, sequence_t::reported_video_step, sequence_t::reset, seq_param_t::scaling_lists_4x4, pic_param_t::scaling_lists_4x4, seq_param_t::scaling_lists_8x8, pic_param_t::scaling_lists_8x8, pic_param_t::second_chroma_qp_index_offset, sequence_t::seq_param, pic_param_t::seq_parameter_set_id, vdpau_mpeg12_decoder_s::sequence, sequence_t::slice_param, sequence_t::slices, sequence_t::slices_count, vdpau_mpeg12_decoder_s::stream, vdpau_accel_t::surface, dpb_frame_t::TopFieldOrderCnt, pic_param_t::transform_8x8_mode_flag, vdpau_accel_t::unlock, dpb_frame_t::used, vdpau_accel_t::vdp_decoder_create, vdpau_accel_t::vdp_decoder_destroy, vdpau_accel_t::vdp_decoder_render, vdpau_accel_t::vdp_device, vdpau_accel_t::vdp_get_error_string, sequence_t::vdp_runtime_nr, vdpau_accel_t::vdp_runtime_nr, xine_stream_s::video_out, sequence_t::video_step, dpb_frame_t::videoSurface, VO_BOTH_FIELDS, vdpau_accel_t::vo_frame, pic_param_t::weighted_bipred_idc, pic_param_t::weighted_pred_flag, xine_format_change_data_t::width, XINE_EVENT_FRAME_FORMAT_CHANGE, xine_event_send(), xine_fast_memcpy, XINE_IMGFMT_VDPAU, XINE_META_INFO_VIDEOCODEC, XINE_STREAM_INFO_FRAME_DURATION, XINE_STREAM_INFO_VIDEO_HEIGHT, XINE_STREAM_INFO_VIDEO_RATIO, and XINE_STREAM_INFO_VIDEO_WIDTH.

Referenced by decode_picture().

◆ dpb_clear_all_pts()

static void dpb_clear_all_pts ( sequence_t sequence)
static

◆ dpb_draw_frames()

static void dpb_draw_frames ( vdpau_h264_alter_decoder_t this_gen,
int32_t  curpoc,
int  draw_mode 
)
static

◆ dpb_get_PicNum()

static dpb_frame_t * dpb_get_PicNum ( sequence_t sequence,
int32_t  pic_num,
int *  index 
)
static

◆ dpb_get_prev_ref()

static dpb_frame_t * dpb_get_prev_ref ( sequence_t sequence)
static

◆ dpb_mmc1()

static void dpb_mmc1 ( vdpau_h264_alter_decoder_t this_gen,
int32_t  picnum 
)
static

◆ dpb_print()

static void dpb_print ( sequence_t sequence)
static

◆ dpb_remove()

static void dpb_remove ( sequence_t sequence,
int  index 
)
static

◆ dpb_reset()

static void dpb_reset ( sequence_t sequence)
static

◆ flush_buffer()

static void flush_buffer ( sequence_t seq)
static

◆ h264_alter_init_plugin()

void * h264_alter_init_plugin ( xine_t xine,
const void *  data 
)

◆ open_plugin()

static video_decoder_t * open_plugin ( video_decoder_class_t class_gen,
xine_stream_t stream 
)
static

◆ parse_codec_private()

static void parse_codec_private ( vdpau_h264_alter_decoder_t this_gen,
const uint8_t *  buf,
uint32_t  len 
)
static

◆ parse_scaling_list()

static void parse_scaling_list ( bits_reader_t br,
uint8_t *  scaling_list,
int  len,
int  index 
)
static

◆ parse_startcodes()

static int parse_startcodes ( vdpau_h264_alter_decoder_t this_gen,
uint8_t *  buf,
uint32_t  len 
)
static

◆ pic_parameter_set()

static void pic_parameter_set ( vdpau_h264_alter_decoder_t this_gen)
static

◆ pred_weight_table()

static void pred_weight_table ( vdpau_h264_alter_decoder_t this_gen,
uint8_t  slice_type,
uint8_t  ChromaArrayType,
uint8_t  l0,
uint8_t  l1 
)
static

◆ ref_pic_list_reordering()

static void ref_pic_list_reordering ( vdpau_h264_alter_decoder_t this_gen)
static

◆ reset_sequence()

static void reset_sequence ( sequence_t sequence)
static

◆ reset_slices()

static void reset_slices ( sequence_t sequence)
static

◆ scaling_list_fallback_A()

static void scaling_list_fallback_A ( uint8_t *  scaling_lists_4x4,
uint8_t *  scaling_lists_8x8,
int  i 
)
static

◆ scaling_list_fallback_B()

static void scaling_list_fallback_B ( seq_param_t sp,
pic_param_t pic,
int  i 
)
static

◆ seq_parameter_set_data()

static void seq_parameter_set_data ( vdpau_h264_alter_decoder_t this_gen)
static

◆ set_ratio()

static void set_ratio ( sequence_t seq,
seq_param_t sp 
)
static

◆ slice_header()

static void slice_header ( vdpau_h264_alter_decoder_t this_gen,
uint8_t  nal_ref_idc,
uint8_t  nal_unit_type 
)
static

◆ slice_header_post()

static void slice_header_post ( vdpau_h264_alter_decoder_t this_gen)
static

◆ vdpau_h264_alter_decode_data()

static void vdpau_h264_alter_decode_data ( video_decoder_t this_gen,
buf_element_t buf 
)
static

◆ vdpau_h264_alter_discontinuity()

static void vdpau_h264_alter_discontinuity ( video_decoder_t this_gen)
static

◆ vdpau_h264_alter_dispose()

static void vdpau_h264_alter_dispose ( video_decoder_t this_gen)
static

References lprintf, MAX_DPB_SIZE, and reset_sequence().

Referenced by open_plugin().

◆ vdpau_h264_alter_flush()

static void vdpau_h264_alter_flush ( video_decoder_t this_gen)
static

References dpb_draw_frames(), DPB_DRAW_REFS, lprintf, and MAX_POC.

Referenced by open_plugin().

◆ vdpau_h264_alter_reset()

static void vdpau_h264_alter_reset ( video_decoder_t this_gen)
static

References lprintf, and reset_sequence().

Referenced by open_plugin().

◆ vui_parameters()

static void vui_parameters ( sequence_t seq,
vui_param_t vui 
)
static

Variable Documentation

◆ default_4x4_inter

const uint8_t default_4x4_inter[16]
static
Initial value:
= {
10, 14, 14, 20,
20, 20, 24, 24,
24, 24, 27, 27,
27, 30, 30, 34
}

Referenced by parse_scaling_list(), and scaling_list_fallback_A().

◆ default_4x4_intra

const uint8_t default_4x4_intra[16]
static
Initial value:
= {
6, 13, 13, 20,
20, 20, 28, 28,
28, 28, 32, 32,
32, 37, 37, 42
}

Referenced by parse_scaling_list(), and scaling_list_fallback_A().

◆ default_8x8_inter

const uint8_t default_8x8_inter[64]
static
Initial value:
= {
9, 13, 13, 15, 13, 15, 17, 17,
17, 17, 19, 19, 19, 19, 19, 21,
21, 21, 21, 21, 21, 22, 22, 22,
22, 22, 22, 22, 24, 24, 24, 24,
24, 24, 24, 24, 25, 25, 25, 25,
25, 25, 25, 27, 27, 27, 27, 27,
27, 28, 28, 28, 28, 28, 30, 30,
30, 30, 32, 32, 32, 33, 33, 35
}

Referenced by parse_scaling_list(), and scaling_list_fallback_A().

◆ default_8x8_intra

const uint8_t default_8x8_intra[64]
static
Initial value:
= {
6, 10, 10, 13, 11, 13, 16, 16,
16, 16, 18, 18, 18, 18, 18, 23,
23, 23, 23, 23, 23, 25, 25, 25,
25, 25, 25, 25, 27, 27, 27, 27,
27, 27, 27, 27, 29, 29, 29, 29,
29, 29, 29, 31, 31, 31, 31, 31,
31, 33, 33, 33, 33, 33, 36, 36,
36, 36, 38, 38, 38, 40, 40, 42
}

Referenced by parse_scaling_list(), and scaling_list_fallback_A().

◆ zigzag_4x4

const uint8_t zigzag_4x4[16]
static
Initial value:
= {
0, 1, 4, 8,
5, 2, 3, 6,
9, 12, 13, 10,
7, 11, 14, 15
}

Referenced by parse_scaling_list(), and scaling_list_fallback_A().

◆ zigzag_8x8

const uint8_t zigzag_8x8[64]
static
Initial value:
= {
0, 1, 8, 16, 9, 2, 3, 10,
17, 24, 32, 25, 18, 11, 4, 5,
12, 19, 26, 33, 40, 48, 41, 34,
27, 20, 13, 6, 7, 14, 21, 28,
35, 42, 49, 56, 57, 50, 43, 36,
29, 22, 15, 23, 30, 37, 44, 51,
58, 59, 52, 45, 38, 31, 39, 46,
53, 60, 61, 54, 47, 55, 62, 63
}

Referenced by parse_scaling_list(), and scaling_list_fallback_A().