xine-lib 1.2.11
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
vdpau_h264.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include <vdpau/vdpau.h>
#include <xine/xine_internal.h>
#include <xine/video_out.h>
#include <xine/buffer.h>
#include <xine/xineutils.h>
#include <xine/list.h>
#include "bswap.h"
#include "accel_vdpau.h"
#include "group_vdpau.h"

Data Structures

struct  hrd_parameters
 
struct  seq_parameter_set_rbsp
 
struct  pic_parameter_set_rbsp
 
struct  sei_message
 
struct  slice_header
 
struct  nal_unit
 
struct  nal_buffer
 
struct  coded_picture
 
struct  decoded_picture
 
struct  dpb
 
struct  h264_parser
 
struct  buf_reader
 
struct  vdpau_h264_decoder_s
 

Macros

#define LOG_MODULE   "vdpau_h264"
 
#define MAX_DPB_COUNT   16
 
#define USED_FOR_REF   (top_is_reference || bottom_is_reference)
 
#define MAX_FRAME_SIZE   1024*1024
 
#define VIDEOBUFSIZE   128*1024
 

Typedefs

typedef struct vdpau_h264_decoder_s vdpau_h264_decoder_t
 

Enumerations

enum  nal_unit_types {
  NAL_UNSPECIFIED = 0 , NAL_SLICE , NAL_PART_A , NAL_PART_B ,
  NAL_PART_C , NAL_SLICE_IDR , NAL_SEI , NAL_SPS ,
  NAL_PPS , NAL_AU_DELIMITER , NAL_END_OF_SEQUENCE , NAL_END_OF_STREAM ,
  NAL_FILLER_DATA , NAL_SPS_EXT
}
 
enum  pic_struct {
  DISP_FRAME = 0 , DISP_TOP , DISP_BOTTOM , DISP_TOP_BOTTOM ,
  DISP_BOTTOM_TOP , DISP_TOP_BOTTOM_TOP , DISP_BOTTOM_TOP_BOTTOM , DISP_FRAME_DOUBLING ,
  DISP_FRAME_TRIPLING
}
 
enum  ct_type { CT_PROGRESSIVE = 0 , CT_INTERLACED , CT_UNKNOWN , CT_RESERVED }
 
enum  slice_types {
  SLICE_P = 0 , SLICE_B , SLICE_I , SLICE_SP ,
  SLICE_SI
}
 
enum  aspect_ratio {
  ASPECT_UNSPECIFIED = 0 , ASPECT_1_1 , ASPECT_12_11 , ASPECT_10_11 ,
  ASPECT_16_11 , ASPECT_40_33 , ASPECT_24_11 , ASPECT_20_11 ,
  ASPECT_32_11 , ASPECT_80_33 , ASPECT_18_11 , ASPECT_15_11 ,
  ASPECT_64_33 , ASPECT_160_99 , ASPECT_4_3 , ASPECT_3_2 ,
  ASPECT_2_1 , ASPECT_RESERVED , ASPECT_EXTENDED_SAR = 255 , ASPECT_UNSPECIFIED = 0 ,
  ASPECT_1_1 , ASPECT_12_11 , ASPECT_10_11 , ASPECT_16_11 ,
  ASPECT_40_33 , ASPECT_24_11 , ASPECT_20_11 , ASPECT_32_11 ,
  ASPECT_80_33 , ASPECT_18_11 , ASPECT_15_11 , ASPECT_64_33 ,
  ASPECT_160_99 , ASPECT_4_3 , ASPECT_3_2 , ASPECT_2_1 ,
  ASPECT_RESERVED , ASPECT_EXTENDED_SAR =255
}
 
enum  picture_flags { IDR_PIC = 0x01 , REFERENCE = 0x02 , NOT_EXISTING = 0x04 , INTERLACED = 0x08 }
 
enum  parser_flags { CPB_DPB_DELAYS_PRESENT = 0x01 , PIC_STRUCT_PRESENT = 0x02 }
 
enum  parser_position { NON_VCL , VCL }
 

Functions

static uint32_t slice_type (uint32_t slice_type)
 
static struct nal_buffercreate_nal_buffer (uint8_t max_size)
 
static void release_nal_unit (struct nal_unit *nal)
 
static void free_nal_buffer (struct nal_buffer *nal_buffer)
 
static void nal_buffer_remove (struct nal_buffer *nal_buffer, struct nal_unit *nal)
 
static void lock_nal_unit (struct nal_unit *nal)
 
static void nal_buffer_append (struct nal_buffer *nal_buffer, struct nal_unit *nal)
 
static struct nal_unitnal_buffer_get_last (struct nal_buffer *nal_buffer)
 
static struct nal_unitnal_buffer_get_by_sps_id (struct nal_buffer *nal_buffer, uint32_t seq_parameter_set_id)
 
static struct nal_unitnal_buffer_get_by_pps_id (struct nal_buffer *nal_buffer, uint32_t pic_parameter_set_id)
 
static struct nal_unitcreate_nal_unit ()
 
static struct coded_picturecreate_coded_picture (void)
 
static void free_coded_picture (struct coded_picture *pic)
 
static int dp_top_field_first (struct decoded_picture *decoded_pic)
 
static void free_decoded_picture (struct decoded_picture *pic)
 
static void decoded_pic_check_reference (struct decoded_picture *pic)
 
static struct decoded_pictureinit_decoded_picture (struct coded_picture *cpic, vo_frame_t *img)
 
static void decoded_pic_add_field (struct decoded_picture *pic, struct coded_picture *cpic)
 
static void release_decoded_picture (struct decoded_picture *pic)
 
static void lock_decoded_picture (struct decoded_picture *pic)
 
static struct dpbcreate_dpb (void)
 
static int dpb_total_frames (struct dpb *dpb)
 
static struct decoded_picturedpb_get_next_out_picture (struct dpb *dpb, int do_flush)
 
static struct decoded_picturedpb_get_picture (struct dpb *dpb, uint32_t picnum)
 
static struct decoded_picturedpb_get_picture_by_ltpn (struct dpb *dpb, uint32_t longterm_picnum)
 
static struct decoded_picturedpb_get_picture_by_ltidx (struct dpb *dpb, uint32_t longterm_idx)
 
static int dpb_unmark_reference_picture (struct dpb *dpb, struct decoded_picture *pic)
 
static int dpb_set_unused_ref_picture_byltpn (struct dpb *dpb, uint32_t longterm_picnum)
 
static int dpb_set_unused_ref_picture_bylidx (struct dpb *dpb, uint32_t longterm_idx)
 
static int dpb_set_unused_ref_picture_lidx_gt (struct dpb *dpb, int32_t longterm_idx)
 
static int dpb_unmark_picture_delayed (struct dpb *dpb, struct decoded_picture *pic)
 
static int dpb_add_picture (struct dpb *dpb, struct decoded_picture *pic, uint32_t num_ref_frames)
 
static int dpb_flush (struct dpb *dpb)
 
static void dpb_free_all (struct dpb *dpb)
 
static void dpb_clear_all_pts (struct dpb *dpb)
 
static int fill_vdpau_reference_list (struct dpb *dpb, VdpReferenceFrameH264 *reflist)
 
static int parse_nal (const uint8_t *buf, int buf_len, struct h264_parser *parser, struct coded_picture **completed_picture)
 
static int seek_for_nal (uint8_t *buf, int buf_len, struct h264_parser *parser)
 
static void free_parser (struct h264_parser *parser)
 
static int parse_frame (struct h264_parser *parser, const uint8_t *inbuf, int inbuf_len, int64_t pts, const void **ret_buf, uint32_t *ret_len, struct coded_picture **ret_pic)
 
static void process_mmc_operations (struct h264_parser *parser, struct coded_picture *picture)
 
static void parse_codec_private (struct h264_parser *parser, const uint8_t *inbuf, int inbuf_len)
 
static uint8_t parse_sps (struct buf_reader *buf, struct seq_parameter_set_rbsp *sps)
 
static void parse_vui_parameters (struct buf_reader *buf, struct seq_parameter_set_rbsp *sps)
 
static void parse_hrd_parameters (struct buf_reader *buf, struct hrd_parameters *hrd)
 
static uint8_t parse_pps (struct buf_reader *buf, struct pic_parameter_set_rbsp *pps)
 
static void parse_sei (struct buf_reader *buf, struct sei_message *sei, struct h264_parser *parser)
 
static uint8_t parse_slice_header (struct buf_reader *buf, struct nal_unit *slc_nal, struct h264_parser *parser)
 
static void parse_ref_pic_list_reordering (struct buf_reader *buf, struct slice_header *slc)
 
static void parse_pred_weight_table (struct buf_reader *buf, struct slice_header *slc, struct h264_parser *parser)
 
static void parse_dec_ref_pic_marking (struct buf_reader *buf, struct nal_unit *slc_nal)
 
static uint32_t bits_read (struct buf_reader *buf)
 
static void skip_emulation_prevention_three_byte (struct buf_reader *buf)
 
static uint32_t read_bits (struct buf_reader *buf, int len)
 
static int rbsp_trailing_bits (const uint8_t *buf, int buf_len)
 
static uint32_t read_exp_golomb (struct buf_reader *buf)
 
static int32_t read_exp_golomb_s (struct buf_reader *buf)
 
static struct nal_unitparse_nal_header (struct buf_reader *buf, struct coded_picture *pic, struct h264_parser *parser)
 
static void calculate_pic_order (struct h264_parser *parser, struct coded_picture *pic, struct slice_header *slc)
 
static void parse_scaling_list (struct buf_reader *buf, uint8_t *scaling_list, int length, int index)
 
static void sps_scaling_list_fallback (struct seq_parameter_set_rbsp *sps, int i)
 
static void pps_scaling_list_fallback (struct seq_parameter_set_rbsp *sps, struct pic_parameter_set_rbsp *pps, int i)
 
static void interpret_sps (struct coded_picture *pic, struct h264_parser *parser)
 
static void interpret_sei (struct coded_picture *pic)
 
static void interpret_pps (struct coded_picture *pic)
 
static void interpret_slice_header (struct h264_parser *parser, struct nal_unit *slc_nal)
 
static void calculate_pic_nums (struct h264_parser *parser, struct coded_picture *cpic)
 
static void execute_ref_pic_marking (struct coded_picture *cpic, uint32_t memory_management_control_operation, uint32_t marking_nr, struct h264_parser *parser)
 
static struct h264_parserinit_parser (xine_t *xine)
 
static void release_dpb (struct dpb *dpb)
 
static void vdpau_h264_reset (video_decoder_t *this_gen)
 
static void vdpau_h264_flush (video_decoder_t *this_gen)
 
static void set_ratio (video_decoder_t *this_gen)
 
static void fill_vdpau_pictureinfo_h264 (video_decoder_t *this_gen, uint32_t slice_count, VdpPictureInfoH264 *pic)
 
static int check_progressive (video_decoder_t *this_gen, struct decoded_picture *dpic)
 
static int vdpau_decoder_init (video_decoder_t *this_gen)
 
static void draw_frames (video_decoder_t *this_gen, int flush)
 
static int vdpau_decoder_render (video_decoder_t *this_gen, VdpBitstreamBuffer *vdp_buffer, uint32_t slice_count)
 
static void vdpau_h264_decode_data (video_decoder_t *this_gen, buf_element_t *buf)
 
static void vdpau_h264_discontinuity (video_decoder_t *this_gen)
 
static void vdpau_h264_dispose (video_decoder_t *this_gen)
 
static video_decoder_topen_plugin (video_decoder_class_t *class_gen, xine_stream_t *stream)
 
void * h264_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

◆ LOG_MODULE

#define LOG_MODULE   "vdpau_h264"

◆ MAX_DPB_COUNT

#define MAX_DPB_COUNT   16

◆ MAX_FRAME_SIZE

#define MAX_FRAME_SIZE   1024*1024

◆ USED_FOR_REF

#define USED_FOR_REF   (top_is_reference || bottom_is_reference)

◆ VIDEOBUFSIZE

#define VIDEOBUFSIZE   128*1024

Typedef Documentation

◆ vdpau_h264_decoder_t

Enumeration Type Documentation

◆ aspect_ratio

Enumerator
ASPECT_UNSPECIFIED 
ASPECT_1_1 
ASPECT_12_11 
ASPECT_10_11 
ASPECT_16_11 
ASPECT_40_33 
ASPECT_24_11 
ASPECT_20_11 
ASPECT_32_11 
ASPECT_80_33 
ASPECT_18_11 
ASPECT_15_11 
ASPECT_64_33 
ASPECT_160_99 
ASPECT_4_3 
ASPECT_3_2 
ASPECT_2_1 
ASPECT_RESERVED 
ASPECT_EXTENDED_SAR 
ASPECT_UNSPECIFIED 
ASPECT_1_1 
ASPECT_12_11 
ASPECT_10_11 
ASPECT_16_11 
ASPECT_40_33 
ASPECT_24_11 
ASPECT_20_11 
ASPECT_32_11 
ASPECT_80_33 
ASPECT_18_11 
ASPECT_15_11 
ASPECT_64_33 
ASPECT_160_99 
ASPECT_4_3 
ASPECT_3_2 
ASPECT_2_1 
ASPECT_RESERVED 
ASPECT_EXTENDED_SAR 

◆ ct_type

enum ct_type
Enumerator
CT_PROGRESSIVE 
CT_INTERLACED 
CT_UNKNOWN 
CT_RESERVED 

◆ nal_unit_types

Enumerator
NAL_UNSPECIFIED 
NAL_SLICE 
NAL_PART_A 
NAL_PART_B 
NAL_PART_C 
NAL_SLICE_IDR 
NAL_SEI 
NAL_SPS 
NAL_PPS 
NAL_AU_DELIMITER 
NAL_END_OF_SEQUENCE 
NAL_END_OF_STREAM 
NAL_FILLER_DATA 
NAL_SPS_EXT 

◆ parser_flags

Enumerator
CPB_DPB_DELAYS_PRESENT 
PIC_STRUCT_PRESENT 

◆ parser_position

Enumerator
NON_VCL 
VCL 

◆ pic_struct

enum pic_struct
Enumerator
DISP_FRAME 
DISP_TOP 
DISP_BOTTOM 
DISP_TOP_BOTTOM 
DISP_BOTTOM_TOP 
DISP_TOP_BOTTOM_TOP 
DISP_BOTTOM_TOP_BOTTOM 
DISP_FRAME_DOUBLING 
DISP_FRAME_TRIPLING 

◆ picture_flags

Enumerator
IDR_PIC 
REFERENCE 
NOT_EXISTING 
INTERLACED 

◆ slice_types

Enumerator
SLICE_P 
SLICE_B 
SLICE_I 
SLICE_SP 
SLICE_SI 

Function Documentation

◆ bits_read()

static uint32_t bits_read ( struct buf_reader buf)
inlinestatic
Returns
total number of bits read by the buf_reader

References bits_read(), and buf_reader::buf.

Referenced by bits_read(), and parse_pps().

◆ calculate_pic_nums()

static void calculate_pic_nums ( struct h264_parser parser,
struct coded_picture cpic 
)
static

◆ calculate_pic_order()

static void calculate_pic_order ( struct h264_parser parser,
struct coded_picture pic,
struct slice_header slc 
)
static

◆ check_progressive()

static int check_progressive ( video_decoder_t this_gen,
struct decoded_picture dpic 
)
static

◆ create_coded_picture()

static struct coded_picture * create_coded_picture ( void  )
inlinestatic

Referenced by init_parser(), and parse_nal().

◆ create_dpb()

static struct dpb * create_dpb ( void  )
static

◆ create_nal_buffer()

static struct nal_buffer * create_nal_buffer ( uint8_t  max_size)
static

References nal_buffer::max_size.

Referenced by init_parser().

◆ create_nal_unit()

static struct nal_unit * create_nal_unit ( )
static

create a new nal unit, with a lock_counter of 1

References nal_unit::lock_counter.

Referenced by parse_nal_header().

◆ decoded_pic_add_field()

static void decoded_pic_add_field ( struct decoded_picture pic,
struct coded_picture cpic 
)
static

◆ decoded_pic_check_reference()

static void decoded_pic_check_reference ( struct decoded_picture pic)
static

◆ dp_top_field_first()

static int dp_top_field_first ( struct decoded_picture decoded_pic)
static

◆ dpb_add_picture()

static int dpb_add_picture ( struct dpb dpb,
struct decoded_picture pic,
uint32_t  num_ref_frames 
)
static

◆ dpb_clear_all_pts()

static void dpb_clear_all_pts ( struct dpb dpb)
static

◆ dpb_flush()

static int dpb_flush ( struct dpb dpb)
static

◆ dpb_free_all()

static void dpb_free_all ( struct dpb dpb)
static

◆ dpb_get_next_out_picture()

static struct decoded_picture * dpb_get_next_out_picture ( struct dpb dpb,
int  do_flush 
)
static

◆ dpb_get_picture()

static struct decoded_picture * dpb_get_picture ( struct dpb dpb,
uint32_t  picnum 
)
static

◆ dpb_get_picture_by_ltidx()

static struct decoded_picture * dpb_get_picture_by_ltidx ( struct dpb dpb,
uint32_t  longterm_idx 
)
static

◆ dpb_get_picture_by_ltpn()

static struct decoded_picture * dpb_get_picture_by_ltpn ( struct dpb dpb,
uint32_t  longterm_picnum 
)
static

◆ dpb_set_unused_ref_picture_bylidx()

static int dpb_set_unused_ref_picture_bylidx ( struct dpb dpb,
uint32_t  longterm_idx 
)
static

◆ dpb_set_unused_ref_picture_byltpn()

static int dpb_set_unused_ref_picture_byltpn ( struct dpb dpb,
uint32_t  longterm_picnum 
)
static

◆ dpb_set_unused_ref_picture_lidx_gt()

static int dpb_set_unused_ref_picture_lidx_gt ( struct dpb dpb,
int32_t  longterm_idx 
)
static

◆ dpb_total_frames()

static int dpb_total_frames ( struct dpb dpb)
static

calculates the total number of frames in the dpb when frames are used for reference and are not drawn yet the result would be less then reference_list-size+ output_list-size

References NULL, dpb::output_list, dpb::reference_list, xine_list_find(), xine_list_front(), xine_list_get_value(), xine_list_next(), and xine_list_size().

Referenced by dpb_add_picture(), and dpb_get_next_out_picture().

◆ dpb_unmark_picture_delayed()

static int dpb_unmark_picture_delayed ( struct dpb dpb,
struct decoded_picture pic 
)
static

◆ dpb_unmark_reference_picture()

static int dpb_unmark_reference_picture ( struct dpb dpb,
struct decoded_picture pic 
)
static

◆ draw_frames()

static void draw_frames ( video_decoder_t this_gen,
int  flush 
)
static

◆ execute_ref_pic_marking()

static void execute_ref_pic_marking ( struct coded_picture cpic,
uint32_t  memory_management_control_operation,
uint32_t  marking_nr,
struct h264_parser parser 
)
static

◆ fill_vdpau_pictureinfo_h264()

static void fill_vdpau_pictureinfo_h264 ( video_decoder_t this_gen,
uint32_t  slice_count,
VdpPictureInfoH264 *  pic 
)
static

◆ fill_vdpau_reference_list()

static int fill_vdpau_reference_list ( struct dpb dpb,
VdpReferenceFrameH264 *  reflist 
)
static

◆ free_coded_picture()

static void free_coded_picture ( struct coded_picture pic)
inlinestatic

◆ free_decoded_picture()

static void free_decoded_picture ( struct decoded_picture pic)
static

◆ free_nal_buffer()

static void free_nal_buffer ( struct nal_buffer nal_buffer)
static

destroys a nal buffer. all referenced nals are released

References nal_buffer::first, nal_unit::next, and release_nal_unit().

Referenced by free_parser().

◆ free_parser()

static void free_parser ( struct h264_parser parser)
static

◆ h264_init_plugin()

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

◆ init_decoded_picture()

static struct decoded_picture * init_decoded_picture ( struct coded_picture cpic,
vo_frame_t img 
)
static

◆ init_parser()

static struct h264_parser * init_parser ( xine_t xine)
static

◆ interpret_pps()

static void interpret_pps ( struct coded_picture pic)
static

◆ interpret_sei()

static void interpret_sei ( struct coded_picture pic)
static

◆ interpret_slice_header()

static void interpret_slice_header ( struct h264_parser parser,
struct nal_unit slc_nal 
)
static

◆ interpret_sps()

static void interpret_sps ( struct coded_picture pic,
struct h264_parser parser 
)
static

◆ lock_decoded_picture()

static void lock_decoded_picture ( struct decoded_picture pic)
static

◆ lock_nal_unit()

static void lock_nal_unit ( struct nal_unit nal)
static

◆ nal_buffer_append()

static void nal_buffer_append ( struct nal_buffer nal_buffer,
struct nal_unit nal 
)
static

◆ nal_buffer_get_by_pps_id()

static struct nal_unit * nal_buffer_get_by_pps_id ( struct nal_buffer nal_buffer,
uint32_t  pic_parameter_set_id 
)
static

◆ nal_buffer_get_by_sps_id()

static struct nal_unit * nal_buffer_get_by_sps_id ( struct nal_buffer nal_buffer,
uint32_t  seq_parameter_set_id 
)
static

◆ nal_buffer_get_last()

static struct nal_unit * nal_buffer_get_last ( struct nal_buffer nal_buffer)
static

returns the last element in the buffer

References nal_buffer::last.

Referenced by parse_sei().

◆ nal_buffer_remove()

static void nal_buffer_remove ( struct nal_buffer nal_buffer,
struct nal_unit nal 
)
static

◆ 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 ( struct h264_parser parser,
const uint8_t *  inbuf,
int  inbuf_len 
)
static

◆ parse_dec_ref_pic_marking()

static void parse_dec_ref_pic_marking ( struct buf_reader buf,
struct nal_unit slc_nal 
)
static

◆ parse_frame()

static int parse_frame ( struct h264_parser parser,
const uint8_t *  inbuf,
int  inbuf_len,
int64_t  pts,
const void **  ret_buf,
uint32_t *  ret_len,
struct coded_picture **  ret_pic 
)
static

◆ parse_hrd_parameters()

static void parse_hrd_parameters ( struct buf_reader buf,
struct hrd_parameters hrd 
)
static

◆ parse_nal()

static int parse_nal ( const uint8_t *  buf,
int  buf_len,
struct h264_parser parser,
struct coded_picture **  completed_picture 
)
static
Returns
0: NAL is part of coded picture 2: NAL is not part of coded picture 1: NAL is the beginning of a new coded picture 3: NAL is marked as END_OF_SEQUENCE

we detect the start of a new access unit if a non-vcl nal unit is received after a vcl nal unit NAL_END_OF_SEQUENCE terminates the current access unit

in case of an access unit which does not contain any non-vcl nal units we have to detect the new access unit through the algorithm for detecting first vcl nal units of a primary coded picture

frame boundary detection according to ITU-T Rec. H264 (11/2007) chapt 7.4.1.2.4, p65

References slice_header::bottom_field_flag, buf_reader::buf, calculate_pic_order(), create_coded_picture(), buf_reader::cur_offset, buf_reader::cur_pos, slice_header::delta_pic_order_cnt, slice_header::delta_pic_order_cnt_bottom, slice_header::field_pic_flag, coded_picture::flag_mask, slice_header::frame_num, IDR_PIC, slice_header::idr_pic_id, interpret_pps(), interpret_sei(), interpret_slice_header(), interpret_sps(), h264_parser::last_vcl_nal, buf_reader::len, lock_nal_unit(), NAL_AU_DELIMITER, nal_buffer_append(), NAL_END_OF_SEQUENCE, NAL_PART_C, NAL_PPS, nal_unit::nal_ref_idc, NAL_SEI, NAL_SLICE, NAL_SLICE_IDR, NAL_SPS, nal_unit::nal_unit_type, NON_VCL, NULL, parse_nal_header(), h264_parser::pic, slice_header::pic_order_cnt_lsb, seq_parameter_set_rbsp::pic_order_cnt_type, slice_header::pic_parameter_set_id, h264_parser::position, h264_parser::pps_buffer, REFERENCE, release_nal_unit(), coded_picture::sei_nal, nal_unit::slc, coded_picture::slc_nal, coded_picture::slice_cnt, nal_unit::sps, h264_parser::sps_buffer, and VCL.

Referenced by parse_codec_private(), and parse_frame().

◆ parse_nal_header()

static struct nal_unit * parse_nal_header ( struct buf_reader buf,
struct coded_picture pic,
struct h264_parser parser 
)
static

◆ parse_pps()

static uint8_t parse_pps ( struct buf_reader buf,
struct pic_parameter_set_rbsp pps 
)
static

References bits_read(), buf_reader::buf, pic_parameter_set_rbsp::chroma_qp_index_offset, pic_parameter_set_rbsp::constrained_intra_pred_flag, pic_parameter_set_rbsp::deblocking_filter_control_present_flag, pic_parameter_set_rbsp::entropy_coding_mode_flag, buf_reader::len, lprintf, pic_parameter_set_rbsp::num_ref_idx_l0_active_minus1, pic_parameter_set_rbsp::num_ref_idx_l1_active_minus1, pic_parameter_set_rbsp::num_slice_groups_minus1, parse_scaling_list(), pic_parameter_set_rbsp::pic_init_qp_minus26, pic_parameter_set_rbsp::pic_init_qs_minus26, pic_parameter_set_rbsp::pic_order_present_flag, pic_parameter_set_rbsp::pic_parameter_set_id, pic_parameter_set_rbsp::pic_scaling_list_present_flag, pic_parameter_set_rbsp::pic_scaling_matrix_present_flag, pic_parameter_set_rbsp::pic_size_in_map_units_minus1, rbsp_trailing_bits(), read_bits(), read_exp_golomb(), read_exp_golomb_s(), pic_parameter_set_rbsp::redundant_pic_cnt_present_flag, pic_parameter_set_rbsp::run_length_minus1, pic_parameter_set_rbsp::scaling_lists_4x4, pic_parameter_set_rbsp::scaling_lists_8x8, pic_parameter_set_rbsp::second_chroma_qp_index_offset, pic_parameter_set_rbsp::seq_parameter_set_id, pic_parameter_set_rbsp::slice_group_change_direction_flag, pic_parameter_set_rbsp::slice_group_change_rate_minus1, pic_parameter_set_rbsp::slice_group_id, pic_parameter_set_rbsp::slice_group_map_type, pic_parameter_set_rbsp::transform_8x8_mode_flag, pic_parameter_set_rbsp::weighted_bipred_idc, and pic_parameter_set_rbsp::weighted_pred_flag.

Referenced by parse_nal_header().

◆ parse_pred_weight_table()

static void parse_pred_weight_table ( struct buf_reader buf,
struct slice_header slc,
struct h264_parser parser 
)
static

◆ parse_ref_pic_list_reordering()

static void parse_ref_pic_list_reordering ( struct buf_reader buf,
struct slice_header slc 
)
static

◆ parse_scaling_list()

static void parse_scaling_list ( struct buf_reader buf,
uint8_t *  scaling_list,
int  length,
int  index 
)
static

◆ parse_sei()

static void parse_sei ( struct buf_reader buf,
struct sei_message sei,
struct h264_parser parser 
)
static

◆ parse_slice_header()

static uint8_t parse_slice_header ( struct buf_reader buf,
struct nal_unit slc_nal,
struct h264_parser parser 
)
static

References slice_header::bottom_field_flag, slice_header::colour_plane_id, slice_header::dec_ref_pic_marking_count, seq_parameter_set_rbsp::delta_pic_order_always_zero_flag, slice_header::delta_pic_order_cnt, slice_header::delta_pic_order_cnt_bottom, slice_header::direct_spatial_mv_pred_flag, slice_header::field_pic_flag, slice_header::first_mb_in_slice, seq_parameter_set_rbsp::frame_mbs_only_flag, slice_header::frame_num, slice_header::idr_pic_id, seq_parameter_set_rbsp::log2_max_frame_num_minus4, seq_parameter_set_rbsp::log2_max_pic_order_cnt_lsb_minus4, nal_buffer_get_by_pps_id(), nal_buffer_get_by_sps_id(), nal_unit::nal_ref_idc, NAL_SLICE_IDR, nal_unit::nal_unit_type, NULL, slice_header::num_ref_idx_active_override_flag, pic_parameter_set_rbsp::num_ref_idx_l0_active_minus1, slice_header::num_ref_idx_l0_active_minus1, pic_parameter_set_rbsp::num_ref_idx_l1_active_minus1, slice_header::num_ref_idx_l1_active_minus1, parse_dec_ref_pic_marking(), parse_pred_weight_table(), parse_ref_pic_list_reordering(), slice_header::pic_order_cnt_lsb, seq_parameter_set_rbsp::pic_order_cnt_type, pic_parameter_set_rbsp::pic_order_present_flag, slice_header::pic_parameter_set_id, nal_unit::pps, h264_parser::pps_buffer, read_bits(), read_exp_golomb(), read_exp_golomb_s(), slice_header::redundant_pic_cnt, pic_parameter_set_rbsp::redundant_pic_cnt_present_flag, seq_parameter_set_rbsp::separate_colour_plane_flag, pic_parameter_set_rbsp::seq_parameter_set_id, nal_unit::slc, SLICE_B, SLICE_P, SLICE_SP, slice_type(), slice_header::slice_type, nal_unit::sps, h264_parser::sps_buffer, pic_parameter_set_rbsp::weighted_bipred_idc, pic_parameter_set_rbsp::weighted_pred_flag, h264_parser::xine, XINE_VERBOSITY_DEBUG, and xprintf.

Referenced by parse_nal_header().

◆ parse_sps()

static uint8_t parse_sps ( struct buf_reader buf,
struct seq_parameter_set_rbsp sps 
)
static

References seq_parameter_set_rbsp::bit_depth_chroma_minus8, seq_parameter_set_rbsp::bit_depth_luma_minus8, seq_parameter_set_rbsp::chroma_format_idc, seq_parameter_set_rbsp::constraint_setN_flag, seq_parameter_set_rbsp::delta_pic_order_always_zero_flag, seq_parameter_set_rbsp::direct_8x8_inference_flag, seq_parameter_set_rbsp::frame_crop_bottom_offset, seq_parameter_set_rbsp::frame_crop_left_offset, seq_parameter_set_rbsp::frame_crop_right_offset, seq_parameter_set_rbsp::frame_crop_top_offset, seq_parameter_set_rbsp::frame_cropping_flag, seq_parameter_set_rbsp::frame_mbs_only_flag, seq_parameter_set_rbsp::gaps_in_frame_num_value_allowed_flag, seq_parameter_set_rbsp::level_idc, seq_parameter_set_rbsp::log2_max_frame_num_minus4, seq_parameter_set_rbsp::log2_max_pic_order_cnt_lsb_minus4, seq_parameter_set_rbsp::max_frame_num, seq_parameter_set_rbsp::mb_adaptive_frame_field_flag, seq_parameter_set_rbsp::num_ref_frames, seq_parameter_set_rbsp::num_ref_frames_in_pic_order_cnt_cycle, seq_parameter_set_rbsp::offset_for_non_ref_pic, seq_parameter_set_rbsp::offset_for_ref_frame, seq_parameter_set_rbsp::offset_for_top_to_bottom_field, parse_scaling_list(), parse_vui_parameters(), seq_parameter_set_rbsp::pic_height, seq_parameter_set_rbsp::pic_order_cnt_type, seq_parameter_set_rbsp::pic_width, seq_parameter_set_rbsp::profile_idc, seq_parameter_set_rbsp::qpprime_y_zero_transform_bypass_flag, read_bits(), read_exp_golomb(), read_exp_golomb_s(), seq_parameter_set_rbsp::scaling_lists_4x4, seq_parameter_set_rbsp::scaling_lists_8x8, seq_parameter_set_rbsp::separate_colour_plane_flag, seq_parameter_set_rbsp::seq_parameter_set_id, seq_parameter_set_rbsp::seq_scaling_list_present_flag, seq_parameter_set_rbsp::seq_scaling_matrix_present_flag, sps_scaling_list_fallback(), and seq_parameter_set_rbsp::vui_parameters_present_flag.

Referenced by parse_nal_header().

◆ parse_vui_parameters()

static void parse_vui_parameters ( struct buf_reader buf,
struct seq_parameter_set_rbsp sps 
)
static

References ASPECT_EXTENDED_SAR, seq_parameter_set_rbsp::aspect_ratio_idc, seq_parameter_set_rbsp::aspect_ration_info_present_flag, seq_parameter_set_rbsp::bitstream_restriction_flag, seq_parameter_set_rbsp::chroma_loc_info_present_flag, seq_parameter_set_rbsp::chroma_sample_loc_type_bottom_field, seq_parameter_set_rbsp::chroma_sample_loc_type_top_field, seq_parameter_set_rbsp::colour_description_present, seq_parameter_set_rbsp::colour_primaries, seq_parameter_set_rbsp::fixed_frame_rate_flag, seq_parameter_set_rbsp::log2_max_mv_length_horizontal, seq_parameter_set_rbsp::log2_max_mv_length_vertical, seq_parameter_set_rbsp::low_delay_hrd_flag, seq_parameter_set_rbsp::matrix_coefficients, seq_parameter_set_rbsp::max_bits_per_mb_denom, seq_parameter_set_rbsp::max_bytes_per_pic_denom, seq_parameter_set_rbsp::max_dec_frame_buffering, seq_parameter_set_rbsp::motion_vectors_over_pic_boundaries, seq_parameter_set_rbsp::nal_hrd_parameters, seq_parameter_set_rbsp::nal_hrd_parameters_present_flag, seq_parameter_set_rbsp::num_reorder_frames, seq_parameter_set_rbsp::num_units_in_tick, seq_parameter_set_rbsp::overscan_appropriate_flag, seq_parameter_set_rbsp::overscan_info_present_flag, parse_hrd_parameters(), seq_parameter_set_rbsp::pic_struct_present_flag, read_bits(), read_exp_golomb(), seq_parameter_set_rbsp::sar_height, seq_parameter_set_rbsp::sar_width, seq_parameter_set_rbsp::time_scale, seq_parameter_set_rbsp::timing_info_present_flag, seq_parameter_set_rbsp::transfer_characteristics, seq_parameter_set_rbsp::vc1_hrd_parameters, seq_parameter_set_rbsp::vc1_hrd_parameters_present_flag, seq_parameter_set_rbsp::video_format, seq_parameter_set_rbsp::video_full_range_flag, seq_parameter_set_rbsp::video_signal_type_present_flag, and seq_parameter_set_rbsp::vui_parameters.

Referenced by parse_sps().

◆ pps_scaling_list_fallback()

static void pps_scaling_list_fallback ( struct seq_parameter_set_rbsp sps,
struct pic_parameter_set_rbsp pps,
int  i 
)
static

◆ process_mmc_operations()

static void process_mmc_operations ( struct h264_parser parser,
struct coded_picture picture 
)
static

◆ rbsp_trailing_bits()

static int rbsp_trailing_bits ( const uint8_t *  buf,
int  buf_len 
)
inlinestatic

References buf_reader::buf, and lprintf.

Referenced by parse_pps().

◆ read_bits()

static uint32_t read_bits ( struct buf_reader buf,
int  len 
)
inlinestatic

◆ read_exp_golomb()

static uint32_t read_exp_golomb ( struct buf_reader buf)
static

◆ read_exp_golomb_s()

static int32_t read_exp_golomb_s ( struct buf_reader buf)
static

◆ release_decoded_picture()

static void release_decoded_picture ( struct decoded_picture pic)
static

◆ release_dpb()

static void release_dpb ( struct dpb dpb)
static

◆ release_nal_unit()

static void release_nal_unit ( struct nal_unit nal)
static

◆ seek_for_nal()

static int seek_for_nal ( uint8_t *  buf,
int  buf_len,
struct h264_parser parser 
)
static

◆ set_ratio()

static void set_ratio ( video_decoder_t this_gen)
static

◆ skip_emulation_prevention_three_byte()

static void skip_emulation_prevention_three_byte ( struct buf_reader buf)
inlinestatic

References buf_reader::buf.

Referenced by read_bits().

◆ slice_type()

static uint32_t slice_type ( uint32_t  slice_type)
inlinestatic

◆ sps_scaling_list_fallback()

static void sps_scaling_list_fallback ( struct seq_parameter_set_rbsp sps,
int  i 
)
static

◆ vdpau_decoder_init()

static int vdpau_decoder_init ( video_decoder_t this_gen)
static

◆ vdpau_decoder_render()

static int vdpau_decoder_render ( video_decoder_t this_gen,
VdpBitstreamBuffer *  vdp_buffer,
uint32_t  slice_count 
)
static

◆ vdpau_h264_decode_data()

static void vdpau_h264_decode_data ( video_decoder_t this_gen,
buf_element_t buf 
)
static

◆ vdpau_h264_discontinuity()

static void vdpau_h264_discontinuity ( video_decoder_t this_gen)
static

References dpb_clear_all_pts(), and VO_NEW_SEQUENCE_FLAG.

Referenced by open_plugin().

◆ vdpau_h264_dispose()

static void vdpau_h264_dispose ( video_decoder_t this_gen)
static

◆ vdpau_h264_flush()

static void vdpau_h264_flush ( video_decoder_t this_gen)
static

◆ vdpau_h264_reset()

static void vdpau_h264_reset ( video_decoder_t this_gen)
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 sps_scaling_list_fallback().

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

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

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

◆ zigzag_4x4

const uint8_t zigzag_4x4[16]
static
Initial value:
= {
0+0*4, 1+0*4, 0+1*4, 0+2*4,
1+1*4, 2+0*4, 3+0*4, 2+1*4,
1+2*4, 0+3*4, 1+3*4, 2+2*4,
3+1*4, 3+2*4, 2+3*4, 3+3*4,
}

Referenced by parse_scaling_list(), and sps_scaling_list_fallback().

◆ zigzag_8x8

const uint8_t zigzag_8x8[64]
static
Initial value:
= {
0+0*8, 1+0*8, 0+1*8, 0+2*8,
1+1*8, 2+0*8, 3+0*8, 2+1*8,
1+2*8, 0+3*8, 0+4*8, 1+3*8,
2+2*8, 3+1*8, 4+0*8, 5+0*8,
4+1*8, 3+2*8, 2+3*8, 1+4*8,
0+5*8, 0+6*8, 1+5*8, 2+4*8,
3+3*8, 4+2*8, 5+1*8, 6+0*8,
7+0*8, 6+1*8, 5+2*8, 4+3*8,
3+4*8, 2+5*8, 1+6*8, 0+7*8,
1+7*8, 2+6*8, 3+5*8, 4+4*8,
5+3*8, 6+2*8, 7+1*8, 7+2*8,
6+3*8, 5+4*8, 4+5*8, 3+6*8,
2+7*8, 3+7*8, 4+6*8, 5+5*8,
6+4*8, 7+3*8, 7+4*8, 6+5*8,
5+6*8, 4+7*8, 5+7*8, 6+6*8,
7+5*8, 7+6*8, 6+7*8, 7+7*8,
}

Referenced by parse_scaling_list(), and sps_scaling_list_fallback().