xine-lib: xine-lib-1.2.13/src/video_dec/libvdpau/vdpau_h264.c File Reference

xine-lib 1.2.13-20230125hg15249

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 }
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_buffer * | create_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_unit * | nal_buffer_get_last (struct nal_buffer *nal_buffer)
static struct nal_unit * | nal_buffer_get_by_sps_id (struct nal_buffer *nal_buffer, uint32_t seq_parameter_set_id)
static struct nal_unit * | nal_buffer_get_by_pps_id (struct nal_buffer *nal_buffer, uint32_t pic_parameter_set_id)
static struct nal_unit * | create_nal_unit ()
static struct coded_picture * | create_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_picture * | init_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 dpb * | create_dpb (void)
static int | dpb_total_frames (struct dpb *dpb)
static struct decoded_picture * | dpb_get_next_out_picture (struct dpb *dpb, int do_flush)
static struct decoded_picture * | dpb_get_picture (struct dpb *dpb, uint32_t picnum)
static struct decoded_picture * | dpb_get_picture_by_ltpn (struct dpb *dpb, uint32_t longterm_picnum)
static struct decoded_picture * | dpb_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_unit * | parse_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 void | release_dpb (struct dpb *dpb)
static struct h264_parser * | init_parser (xine_t *xine)
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_t * | open_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

Referenced by create_dpb().

## ◆ MAX_FRAME_SIZE

#define MAX_FRAME_SIZE 1024*1024

Referenced by parse_frame().

## ◆ USED_FOR_REF

#define USED_FOR_REF (top_is_reference || bottom_is_reference)

## ◆ VIDEOBUFSIZE

#define VIDEOBUFSIZE 128*1024

## Typedef Documentation

## ◆ vdpau_h264_decoder_t

typedef struct vdpau_h264_decoder_s vdpau_h264_decoder_t

## Enumeration Type Documentation

## ◆ aspect_ratio

enum 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 |

## ◆ ct_type

enum ct_type

Enumerator
CT_PROGRESSIVE |
CT_INTERLACED |
CT_UNKNOWN |
CT_RESERVED |

## ◆ nal_unit_types

enum 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

enum parser_flags

Enumerator
CPB_DPB_DELAYS_PRESENT |
PIC_STRUCT_PRESENT |

## ◆ parser_position

enum 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

enum picture_flags

Enumerator
IDR_PIC |
REFERENCE |
NOT_EXISTING |
INTERLACED |

## ◆ slice_types

enum 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

PicNum calculation following ITU-T H264 11/2007 8.2.4.1 p112f

References slice_header::bottom_field_flag, decoded_picture::coded_pic, h264_parser::dpb, slice_header::field_pic_flag, slice_header::frame_num, decoded_picture::frame_num_wrap, coded_picture::long_term_frame_idx, coded_picture::long_term_pic_num, seq_parameter_set_rbsp::max_frame_num, NULL, coded_picture::pic_num, dpb::reference_list, nal_unit::slc, coded_picture::slc_nal, nal_unit::sps, coded_picture::sps_nal, coded_picture::used_for_long_term_ref, xine_list_front(), xine_list_get_value(), and xine_list_next().

Referenced by execute_ref_pic_marking().

## ◆ calculate_pic_order()

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

calculates the picture order count according to ITU-T Rec. H.264 (11/2007) chapter 8.2.1, p104f

References slice_header::bottom_field_flag, coded_picture::bottom_field_order_cnt, slice_header::delta_pic_order_cnt_bottom, slice_header::field_pic_flag, coded_picture::flag_mask, slice_header::frame_num, h264_parser::frame_num_offset, IDR_PIC, h264_parser::last_vcl_nal, seq_parameter_set_rbsp::log2_max_pic_order_cnt_lsb_minus4, seq_parameter_set_rbsp::max_frame_num, nal_buffer_get_by_pps_id(), nal_buffer_get_by_sps_id(), NULL, h264_parser::pic, slice_header::pic_order_cnt_lsb, seq_parameter_set_rbsp::pic_order_cnt_type, slice_header::pic_parameter_set_id, nal_unit::pps, h264_parser::pps_buffer, h264_parser::prev_pic_order_cnt_lsb, h264_parser::prev_pic_order_cnt_msb, h264_parser::prev_top_field_order_cnt, REFERENCE, pic_parameter_set_rbsp::seq_parameter_set_id, nal_unit::slc, nal_unit::sps, h264_parser::sps_buffer, coded_picture::top_field_order_cnt, h264_parser::xine, XINE_VERBOSITY_DEBUG, and xprintf.

Referenced by parse_nal().

## ◆ check_progressive()

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

References decoded_picture::coded_pic, slice_header::delta_pic_order_cnt_bottom, DISP_BOTTOM_TOP, DISP_FRAME, DISP_TOP_BOTTOM, slice_header::field_pic_flag, coded_picture::flag_mask, seq_parameter_set_rbsp::frame_mbs_only_flag, NULL, pic_parameter_set_rbsp::pic_order_present_flag, sei_message::pic_struct, PIC_STRUCT_PRESENT, sei_message::pic_timing, nal_unit::pps, coded_picture::pps_nal, nal_unit::sei, coded_picture::sei_nal, nal_unit::slc, coded_picture::slc_nal, nal_unit::sps, and coded_picture::sps_nal.

Referenced by draw_frames().

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

## dpb code starting here

References MAX_DPB_COUNT, dpb::max_dpb_frames, dpb::max_reorder_frames, NULL, dpb::output_list, dpb::reference_list, and xine_list_new().

Referenced by init_parser().

## ◆ create_nal_buffer()

static struct nal_buffer * create_nal_buffer | ( | uint8_t | max_size | ) |
| static

References nal_buffer::max_size, and NULL.

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, and NULL.

Referenced by parse_nal_header().

## ◆ decoded_pic_add_field()

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

References decoded_picture::coded_pic, and decoded_pic_check_reference().

Referenced by vdpau_decoder_render().

## ◆ decoded_pic_check_reference()

static void decoded_pic_check_reference | ( | struct decoded_picture * | pic | ) |
| static

References slice_header::bottom_field_flag, decoded_picture::bottom_is_reference, decoded_picture::coded_pic, slice_header::field_pic_flag, coded_picture::flag_mask, REFERENCE, nal_unit::slc, coded_picture::slc_nal, and decoded_picture::top_is_reference.

Referenced by decoded_pic_add_field(), and init_decoded_picture().

## ◆ dp_top_field_first()

static int dp_top_field_first | ( | struct decoded_picture * | decoded_pic | ) |
| static

References slice_header::bottom_field_flag, coded_picture::bottom_field_order_cnt, decoded_picture::coded_pic, DISP_BOTTOM_TOP, DISP_BOTTOM_TOP_BOTTOM, DISP_FRAME, DISP_TOP_BOTTOM, DISP_TOP_BOTTOM_TOP, coded_picture::flag_mask, NULL, sei_message::pic_struct, PIC_STRUCT_PRESENT, sei_message::pic_timing, nal_unit::sei, coded_picture::sei_nal, nal_unit::slc, coded_picture::slc_nal, and coded_picture::top_field_order_cnt.

Referenced by draw_frames().

## ◆ dpb_add_picture()

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

References decoded_picture::coded_pic, dpb_total_frames(), dpb_unmark_reference_picture(), coded_picture::flag_mask, vo_frame_s::free, decoded_picture::img, vo_frame_s::lock, lock_decoded_picture(), lprintf, NULL, dpb::output_list, REFERENCE, dpb::reference_list, xine_list_front(), xine_list_get_value(), xine_list_push_back(), and xine_list_size().

Referenced by vdpau_decoder_render().

## ◆ dpb_clear_all_pts()

static void dpb_clear_all_pts | ( | struct dpb * | dpb | ) |
| static

References decoded_picture::img, dpb::output_list, vo_frame_s::pts, xine_list_front(), xine_list_get_value(), and xine_list_next().

Referenced by vdpau_h264_discontinuity().

## ◆ dpb_flush()

static int dpb_flush | ( | struct dpb * | dpb | ) |
| static

References dpb_unmark_reference_picture(), NULL, dpb::reference_list, xine_list_front(), and xine_list_get_value().

Referenced by execute_ref_pic_marking(), and vdpau_decoder_render().

## ◆ dpb_free_all()

static void dpb_free_all | ( | struct dpb * | dpb | ) |
| static

References dpb_unmark_picture_delayed(), dpb_unmark_reference_picture(), dpb::output_list, dpb::reference_list, xine_list_front(), and xine_list_get_value().

Referenced by free_parser(), release_dpb(), vdpau_h264_dispose(), vdpau_h264_flush(), and vdpau_h264_reset().

## ◆ dpb_get_next_out_picture()

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

References coded_picture::bottom_field_order_cnt, decoded_picture::coded_pic, dpb_total_frames(), coded_picture::flag_mask, IDR_PIC, dpb::max_dpb_frames, dpb::max_reorder_frames, NULL, dpb::output_list, coded_picture::top_field_order_cnt, xine_list_prev_value(), and xine_list_size().

Referenced by draw_frames().

## ◆ dpb_get_picture()

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

References decoded_picture::coded_pic, NULL, coded_picture::pic_num, dpb::reference_list, xine_list_front(), xine_list_get_value(), and xine_list_next().

Referenced by execute_ref_pic_marking().

## ◆ dpb_get_picture_by_ltidx()

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

References decoded_picture::coded_pic, coded_picture::long_term_frame_idx, NULL, dpb::reference_list, xine_list_front(), xine_list_get_value(), and xine_list_next().

Referenced by execute_ref_pic_marking().

## ◆ dpb_get_picture_by_ltpn()

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

References decoded_picture::coded_pic, coded_picture::long_term_pic_num, NULL, dpb::reference_list, xine_list_front(), xine_list_get_value(), and xine_list_next().

Referenced by execute_ref_pic_marking().

## ◆ dpb_set_unused_ref_picture_bylidx()

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

References decoded_picture::coded_pic, dpb_unmark_reference_picture(), coded_picture::long_term_frame_idx, NULL, dpb::reference_list, coded_picture::used_for_long_term_ref, xine_list_front(), xine_list_get_value(), and xine_list_next().

Referenced by execute_ref_pic_marking().

## ◆ dpb_set_unused_ref_picture_byltpn()

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

References decoded_picture::coded_pic, dpb_unmark_reference_picture(), coded_picture::long_term_pic_num, NULL, dpb::reference_list, coded_picture::used_for_long_term_ref, xine_list_front(), xine_list_get_value(), and xine_list_next().

Referenced by execute_ref_pic_marking().

## ◆ dpb_set_unused_ref_picture_lidx_gt()

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

References decoded_picture::coded_pic, dpb_unmark_reference_picture(), coded_picture::long_term_frame_idx, NULL, dpb::reference_list, coded_picture::used_for_long_term_ref, xine_list_front(), xine_list_get_value(), and xine_list_next().

Referenced by execute_ref_pic_marking().

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

References dpb::output_list, release_decoded_picture(), xine_list_find(), and xine_list_remove().

Referenced by dpb_free_all(), draw_frames(), and vdpau_decoder_render().

## ◆ dpb_unmark_reference_picture()

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

References dpb::reference_list, release_decoded_picture(), xine_list_find(), and xine_list_remove().

Referenced by dpb_add_picture(), dpb_flush(), dpb_free_all(), dpb_set_unused_ref_picture_bylidx(), dpb_set_unused_ref_picture_byltpn(), dpb_set_unused_ref_picture_lidx_gt(), execute_ref_pic_marking(), and vdpau_decoder_render().

## ◆ draw_frames()

static void draw_frames | ( | video_decoder_t * | this_gen,
|  | int | flush )
| static

References check_progressive(), dp_top_field_first(), dpb_get_next_out_picture(), dpb_unmark_picture_delayed(), vo_frame_s::draw, decoded_picture::img, NULL, vo_frame_s::progressive_frame, vo_frame_s::pts, vo_frame_s::stream, vo_frame_s::top_field_first, XINE_VERBOSITY_DEBUG, and xprintf.

Referenced by vdpau_decoder_render(), and vdpau_h264_flush().

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

according to NOTE 6, p83 the dec_ref_pic_marking structure is identical for all slice headers within a coded picture, so we can simply use the last slice_header we saw in the pic

References slice_header::bottom_field_flag, decoded_picture::bottom_is_reference, calculate_pic_nums(), decoded_picture::coded_pic, h264_parser::curr_pic_num, slice_header::dec_ref_pic_marking, slice_header::difference_of_pic_nums_minus1, h264_parser::dpb, dpb_flush(), dpb_get_picture(), dpb_get_picture_by_ltidx(), dpb_get_picture_by_ltpn(), dpb_set_unused_ref_picture_bylidx(), dpb_set_unused_ref_picture_byltpn(), dpb_set_unused_ref_picture_lidx_gt(), dpb_unmark_reference_picture(), slice_header::field_pic_flag, coded_picture::flag_mask, IDR_PIC, coded_picture::long_term_frame_idx, slice_header::long_term_frame_idx, coded_picture::long_term_pic_num, slice_header::long_term_pic_num, slice_header::long_term_reference_flag, slice_header::max_long_term_frame_idx_plus1, NULL, coded_picture::pic_num, h264_parser::prev_pic_order_cnt_lsb, h264_parser::prev_pic_order_cnt_msb, nal_unit::slc, coded_picture::slc_nal, coded_picture::top_field_order_cnt, decoded_picture::top_is_reference, coded_picture::used_for_long_term_ref, h264_parser::xine, XINE_VERBOSITY_DEBUG, and xprintf.

Referenced by process_mmc_operations().

## ◆ fill_vdpau_pictureinfo_h264()

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

References slice_header::bottom_field_flag, 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, seq_parameter_set_rbsp::delta_pic_order_always_zero_flag, seq_parameter_set_rbsp::direct_8x8_inference_flag, pic_parameter_set_rbsp::entropy_coding_mode_flag, slice_header::field_pic_flag, fill_vdpau_reference_list(), seq_parameter_set_rbsp::frame_mbs_only_flag, slice_header::frame_num, seq_parameter_set_rbsp::log2_max_frame_num_minus4, seq_parameter_set_rbsp::log2_max_pic_order_cnt_lsb_minus4, seq_parameter_set_rbsp::mb_adaptive_frame_field_flag, seq_parameter_set_rbsp::num_ref_frames, pic_parameter_set_rbsp::num_ref_idx_l0_active_minus1, pic_parameter_set_rbsp::num_ref_idx_l1_active_minus1, pic_parameter_set_rbsp::pic_init_qp_minus26, seq_parameter_set_rbsp::pic_order_cnt_type, pic_parameter_set_rbsp::pic_order_present_flag, pic_parameter_set_rbsp::redundant_pic_cnt_present_flag, REFERENCE, 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::transform_8x8_mode_flag, pic_parameter_set_rbsp::weighted_bipred_idc, and pic_parameter_set_rbsp::weighted_pred_flag.

Referenced by vdpau_decoder_render().

## ◆ fill_vdpau_reference_list()

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

References vo_frame_s::accel_data, coded_picture::bottom_field_order_cnt, decoded_picture::bottom_is_reference, decoded_picture::coded_pic, slice_header::frame_num, decoded_picture::img, coded_picture::long_term_pic_num, NULL, dpb::reference_list, nal_unit::slc, coded_picture::slc_nal, coded_picture::top_field_order_cnt, decoded_picture::top_is_reference, coded_picture::used_for_long_term_ref, and xine_list_prev_value().

Referenced by fill_vdpau_pictureinfo_h264().

## ◆ free_coded_picture()

static void free_coded_picture | ( | struct coded_picture * | pic | ) |
| inlinestatic

References coded_picture::pps_nal, release_nal_unit(), coded_picture::sei_nal, coded_picture::slc_nal, and coded_picture::sps_nal.

Referenced by free_decoded_picture(), vdpau_decoder_render(), and vdpau_h264_decode_data().

## ◆ free_decoded_picture()

static void free_decoded_picture | ( | struct decoded_picture * | pic | ) |
| static

## decoded picture

References decoded_picture::coded_pic, vo_frame_s::free, free_coded_picture(), decoded_picture::img, and NULL.

Referenced by release_decoded_picture().

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

References h264_parser::dpb, dpb_free_all(), free_nal_buffer(), h264_parser::pps_buffer, release_dpb(), and h264_parser::sps_buffer.

Referenced by init_parser(), vdpau_h264_dispose(), and vdpau_h264_reset().

## ◆ h264_init_plugin()

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

References video_decoder_s::dispose, N_, NULL, open_plugin(), and video_decoder_class_s::open_plugin.

## ◆ init_decoded_picture()

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

References decoded_picture::coded_pic, decoded_pic_check_reference(), decoded_picture::img, decoded_picture::lock_counter, and NULL.

Referenced by vdpau_decoder_render().

## ◆ init_parser()

static struct h264_parser * init_parser | ( | xine_t * | xine | ) |
| static

References create_coded_picture(), create_dpb(), create_nal_buffer(), h264_parser::dpb, free_parser(), h264_parser::last_vcl_nal, NON_VCL, NULL, h264_parser::pic, h264_parser::position, h264_parser::pps_buffer, h264_parser::sps_buffer, and h264_parser::xine.

Referenced by open_plugin(), and vdpau_h264_reset().

## ◆ interpret_pps()

static void interpret_pps | ( | struct coded_picture * | pic | ) |
| static

References lprintf, NULL, pic_parameter_set_rbsp::pic_scaling_list_present_flag, pic_parameter_set_rbsp::pic_scaling_matrix_present_flag, nal_unit::pps, coded_picture::pps_nal, pps_scaling_list_fallback(), pic_parameter_set_rbsp::scaling_lists_4x4, seq_parameter_set_rbsp::scaling_lists_4x4, pic_parameter_set_rbsp::scaling_lists_8x8, seq_parameter_set_rbsp::scaling_lists_8x8, nal_unit::sps, and coded_picture::sps_nal.

Referenced by parse_nal().

## ◆ interpret_sei()

static void interpret_sei | ( | struct coded_picture * | pic | ) |
| static

References DISP_BOTTOM, DISP_BOTTOM_TOP, DISP_BOTTOM_TOP_BOTTOM, DISP_FRAME, DISP_FRAME_DOUBLING, DISP_FRAME_TRIPLING, DISP_TOP, DISP_TOP_BOTTOM, DISP_TOP_BOTTOM_TOP, coded_picture::flag_mask, INTERLACED, sei_message::pic_struct, seq_parameter_set_rbsp::pic_struct_present_flag, sei_message::pic_timing, coded_picture::repeat_pic, nal_unit::sei, coded_picture::sei_nal, nal_unit::sps, coded_picture::sps_nal, seq_parameter_set_rbsp::vui_parameters, and seq_parameter_set_rbsp::vui_parameters_present_flag.

Referenced by parse_nal().

## ◆ interpret_slice_header()

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

References lock_nal_unit(), nal_buffer_get_by_pps_id(), nal_buffer_get_by_sps_id(), NULL, h264_parser::pic, slice_header::pic_parameter_set_id, nal_unit::pps, h264_parser::pps_buffer, coded_picture::pps_nal, release_nal_unit(), pic_parameter_set_rbsp::seq_parameter_set_id, nal_unit::slc, h264_parser::sps_buffer, coded_picture::sps_nal, h264_parser::xine, XINE_VERBOSITY_DEBUG, and xprintf.

Referenced by parse_nal().

## ◆ interpret_sps()

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

References CPB_DPB_DELAYS_PRESENT, h264_parser::curr_pic_num, slice_header::field_pic_flag, h264_parser::flag_mask, slice_header::frame_num, seq_parameter_set_rbsp::max_frame_num, coded_picture::max_pic_num, seq_parameter_set_rbsp::nal_hrd_parameters_present_flag, NULL, PIC_STRUCT_PRESENT, seq_parameter_set_rbsp::pic_struct_present_flag, nal_unit::slc, coded_picture::slc_nal, nal_unit::sps, coded_picture::sps_nal, seq_parameter_set_rbsp::vc1_hrd_parameters_present_flag, seq_parameter_set_rbsp::vui_parameters, seq_parameter_set_rbsp::vui_parameters_present_flag, h264_parser::xine, XINE_VERBOSITY_DEBUG, and xprintf.

Referenced by parse_nal().

## ◆ lock_decoded_picture()

static void lock_decoded_picture | ( | struct decoded_picture * | pic | ) |
| static

References decoded_picture::lock_counter.

Referenced by dpb_add_picture(), and vdpau_decoder_render().

## ◆ lock_nal_unit()

static void lock_nal_unit | ( | struct nal_unit * | nal | ) |
| static

References nal_unit::lock_counter.

Referenced by interpret_slice_header(), nal_buffer_append(), and parse_nal().

## ◆ nal_buffer_append()

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

appends a nal unit to the end of the buffer

References nal_buffer::first, nal_buffer::last, lock_nal_unit(), lprintf, nal_buffer::max_size, nal_buffer_remove(), nal_unit::next, NULL, nal_unit::prev, and nal_buffer::used.

Referenced by parse_codec_private(), and parse_nal().

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

get a nal unit from a nal_buffer from it's pic parameter_set_id

References nal_buffer::last, NAL_PPS, nal_unit::nal_unit_type, NULL, pic_parameter_set_rbsp::pic_parameter_set_id, nal_unit::pps, and nal_unit::prev.

Referenced by calculate_pic_order(), interpret_slice_header(), parse_pred_weight_table(), and parse_slice_header().

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

get a nal unit from a nal_buffer from it's seq parameter_set_id

References nal_buffer::last, NAL_SPS, nal_unit::nal_unit_type, NULL, nal_unit::prev, seq_parameter_set_rbsp::seq_parameter_set_id, and nal_unit::sps.

Referenced by calculate_pic_order(), interpret_slice_header(), parse_pred_weight_table(), and parse_slice_header().

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

References nal_buffer::first, nal_buffer::last, nal_unit::next, NULL, nal_unit::prev, release_nal_unit(), and nal_buffer::used.

Referenced by nal_buffer_append().

## ◆ open_plugin()

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

References vo_frame_s::accel_data, vo_frame_s::free, xine_video_port_s::get_capabilities, xine_video_port_s::get_frame, decoded_picture::img, init_parser(), vdpau_accel_t::lock, lprintf, NULL, xine_video_port_s::open, vdpau_h264_decoder_s::stream, vdpau_accel_t::unlock, vdpau_accel_t::vdp_decoder_create, vdpau_accel_t::vdp_decoder_destroy, vdpau_accel_t::vdp_device, vdpau_accel_t::vdp_runtime_nr, vdpau_h264_decode_data(), vdpau_h264_discontinuity(), vdpau_h264_dispose(), vdpau_h264_flush(), vdpau_h264_reset(), xine_stream_s::video_out, VO_BOTH_FIELDS, VO_CAP_VDPAU_H264, vdpau_accel_t::vo_frame, VO_GET_FRAME_MAY_FAIL, VO_NEW_SEQUENCE_FLAG, xine_stream_s::xine, and XINE_IMGFMT_VDPAU.

Referenced by h264_init_plugin().

## ◆ parse_codec_private()

static void parse_codec_private | ( | struct h264_parser * | parser,
|  | const uint8_t * | inbuf,
|  | int | inbuf_len )
| static

References buf_reader::buf, buf_reader::cur_offset, buf_reader::cur_pos, buf_reader::len, seq_parameter_set_rbsp::level_idc, nal_buffer_append(), h264_parser::nal_size_length, h264_parser::nal_size_length_buf, NULL, parse_nal(), seq_parameter_set_rbsp::profile_idc, read_bits(), nal_unit::sps, and h264_parser::sps_buffer.

Referenced by vdpau_h264_decode_data(), and vdpau_h264_reset().

## ◆ parse_dec_ref_pic_marking()

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

References slice_header::adaptive_ref_pic_marking_mode_flag, slice_header::dec_ref_pic_marking, slice_header::dec_ref_pic_marking_count, slice_header::difference_of_pic_nums_minus1, slice_header::long_term_frame_idx, slice_header::long_term_pic_num, slice_header::long_term_reference_flag, lprintf, slice_header::max_long_term_frame_idx_plus1, slice_header::memory_management_control_operation, NAL_SLICE_IDR, nal_unit::nal_unit_type, slice_header::no_output_of_prior_pics_flag, read_bits(), read_exp_golomb(), and nal_unit::slc.

Referenced by parse_slice_header().

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

if the new coded picture started with a VCL nal we have to copy this to buffer for the next picture now.

References h264_parser::buf, h264_parser::buf_len, h264_parser::last_nal_res, MAX_FRAME_SIZE, h264_parser::nal_size_length, NULL, parse_nal(), h264_parser::pic, h264_parser::prebuf, h264_parser::prebuf_len, coded_picture::pts, seek_for_nal(), coded_picture::slice_cnt, h264_parser::xine, xine_fast_memcpy, XINE_VERBOSITY_LOG, and xprintf.

Referenced by vdpau_h264_decode_data().

## ◆ parse_hrd_parameters()

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

References hrd_parameters::bit_rate_scale, hrd_parameters::bit_rate_value_minus1, hrd_parameters::cbr_flag, hrd_parameters::cpb_cnt_minus1, hrd_parameters::cpb_removal_delay_length_minus1, hrd_parameters::cpb_size_scale, hrd_parameters::cpb_size_value_minus1, hrd_parameters::dpb_output_delay_length_minus1, hrd_parameters::initial_cpb_removal_delay_length_minus1, read_bits(), read_exp_golomb(), and hrd_parameters::time_offset_length.

Referenced by parse_vui_parameters().

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

parses the NAL header data and calls the subsequent parser methods that handle specific NAL units

References buf_reader::buf, create_nal_unit(), buf_reader::cur_pos, buf_reader::len, NAL_PART_A, NAL_PART_B, NAL_PART_C, NAL_PPS, nal_unit::nal_ref_idc, NAL_SEI, NAL_SLICE, NAL_SLICE_IDR, NAL_SPS, nal_unit::nal_unit_type, NULL, parse_pps(), parse_sei(), parse_slice_header(), parse_sps(), nal_unit::pps, nal_unit::sei, and nal_unit::sps.

Referenced by parse_nal().

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

References seq_parameter_set_rbsp::chroma_format_idc, slice_header::chroma_log2_weight_denom, slice_header::chroma_offset_l0, slice_header::chroma_offset_l1, slice_header::chroma_weight_l0, slice_header::chroma_weight_l1, slice_header::luma_log2_weight_denom, slice_header::luma_offset_l0, slice_header::luma_offset_l1, slice_header::luma_weight_l0, slice_header::luma_weight_l1, nal_buffer_get_by_pps_id(), nal_buffer_get_by_sps_id(), slice_header::num_ref_idx_l0_active_minus1, slice_header::num_ref_idx_l1_active_minus1, slice_header::pic_parameter_set_id, nal_unit::pps, h264_parser::pps_buffer, slice_header::pred_weight_table, read_bits(), read_exp_golomb(), read_exp_golomb_s(), seq_parameter_set_rbsp::separate_colour_plane_flag, pic_parameter_set_rbsp::seq_parameter_set_id, SLICE_B, slice_header::slice_type, nal_unit::sps, and h264_parser::sps_buffer.

Referenced by parse_slice_header().

## ◆ parse_ref_pic_list_reordering()

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

References slice_header::abs_diff_pic_num_minus1, slice_header::long_term_pic_num, read_bits(), read_exp_golomb(), slice_header::ref_pic_list_reordering, slice_header::ref_pic_list_reordering_flag_l0, slice_header::ref_pic_list_reordering_flag_l1, slice_header::reordering_of_pic_nums_idc, nal_unit::slc, SLICE_B, SLICE_I, SLICE_SI, and slice_header::slice_type.

Referenced by parse_slice_header().

## ◆ parse_scaling_list()

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

References default_4x4_inter, default_4x4_intra, default_8x8_inter, default_8x8_intra, read_exp_golomb_s(), zigzag_4x4, and zigzag_8x8.

Referenced by parse_pps(), and parse_sps().

## ◆ parse_sei()

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

References sei_message::cnt_dropped_flag, sei_message::counting_type, CPB_DPB_DELAYS_PRESENT, sei_message::cpb_removal_delay, sei_message::ct_type, sei_message::discontinuity_flag, sei_message::dpb_output_delay, h264_parser::flag_mask, sei_message::full_timestamp_flag, sei_message::hours_value, sei_message::last_payload_size_byte, sei_message::last_payload_type_byte, sei_message::minutes_value, sei_message::n_frames, nal_buffer_get_last(), seq_parameter_set_rbsp::nal_hrd_parameters, seq_parameter_set_rbsp::nal_hrd_parameters_present_flag, sei_message::nuit_field_based_flag, NULL, sei_message::payload_size, sei_message::payload_type, sei_message::pic_struct, PIC_STRUCT_PRESENT, sei_message::pic_timing, read_bits(), sei_message::seconds_value, nal_unit::sps, h264_parser::sps_buffer, sei_message::time_offset, hrd_parameters::time_offset_length, seq_parameter_set_rbsp::vui_parameters, seq_parameter_set_rbsp::vui_parameters_present_flag, h264_parser::xine, XINE_VERBOSITY_DEBUG, and xprintf.

Referenced by parse_nal_header().

## ◆ 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_header::slice_type, 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

References pic_parameter_set_rbsp::scaling_lists_4x4, seq_parameter_set_rbsp::scaling_lists_4x4, pic_parameter_set_rbsp::scaling_lists_8x8, and seq_parameter_set_rbsp::scaling_lists_8x8.

Referenced by interpret_pps().

## ◆ process_mmc_operations()

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

References slice_header::dec_ref_pic_marking, execute_ref_pic_marking(), coded_picture::flag_mask, slice_header::pic_order_cnt_lsb, h264_parser::prev_pic_order_cnt_lsb, REFERENCE, nal_unit::slc, and coded_picture::slc_nal.

Referenced by vdpau_decoder_render().

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

References bits, buf_reader::buf, buf_reader::len, and skip_emulation_prevention_three_byte().

Referenced by parse_codec_private(), parse_dec_ref_pic_marking(), parse_hrd_parameters(), parse_pps(), parse_pred_weight_table(), parse_ref_pic_list_reordering(), parse_sei(), parse_slice_header(), parse_sps(), parse_vui_parameters(), read_exp_golomb(), and seek_for_nal().

## ◆ read_exp_golomb()

static uint32_t read_exp_golomb | ( | struct buf_reader * | buf | ) |
| static

References buf_reader::buf, code, and read_bits().

Referenced by parse_dec_ref_pic_marking(), parse_hrd_parameters(), parse_pps(), parse_pred_weight_table(), parse_ref_pic_list_reordering(), parse_slice_header(), parse_sps(), parse_vui_parameters(), and read_exp_golomb_s().

## ◆ read_exp_golomb_s()

static int32_t read_exp_golomb_s | ( | struct buf_reader * | buf | ) |
| static

References buf_reader::buf, code, and read_exp_golomb().

Referenced by parse_pps(), parse_pred_weight_table(), parse_scaling_list(), parse_slice_header(), and parse_sps().

## ◆ release_decoded_picture()

static void release_decoded_picture | ( | struct decoded_picture * | pic | ) |
| static

References free_decoded_picture(), and decoded_picture::lock_counter.

Referenced by dpb_unmark_picture_delayed(), dpb_unmark_reference_picture(), vdpau_decoder_render(), vdpau_h264_dispose(), vdpau_h264_flush(), and vdpau_h264_reset().

## ◆ release_dpb()

static void release_dpb | ( | struct dpb * | dpb | ) |
| static

References dpb_free_all(), dpb::output_list, dpb::reference_list, and xine_list_delete().

Referenced by free_parser().

## ◆ release_nal_unit()

static void release_nal_unit | ( | struct nal_unit * | nal | ) |
| static

References nal_unit::lock_counter.

Referenced by free_coded_picture(), free_nal_buffer(), interpret_slice_header(), nal_buffer_remove(), and parse_nal().

## ◆ seek_for_nal()

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

References buf_reader::buf, buf_reader::cur_offset, buf_reader::cur_pos, buf_reader::len, NAL_END_OF_SEQUENCE, h264_parser::nal_size_length, h264_parser::next_nal_position, and read_bits().

Referenced by parse_frame().

## ◆ set_ratio()

static void set_ratio | ( | video_decoder_t * | this_gen | ) |
| static

References ASPECT_10_11, ASPECT_12_11, ASPECT_15_11, ASPECT_160_99, ASPECT_16_11, ASPECT_18_11, ASPECT_1_1, ASPECT_20_11, ASPECT_24_11, ASPECT_2_1, ASPECT_32_11, ASPECT_3_2, ASPECT_40_33, ASPECT_4_3, ASPECT_64_33, ASPECT_80_33, ASPECT_EXTENDED_SAR, height, and width.

Referenced by vdpau_decoder_init().

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

References slice_type().

Referenced by _vdec_hw_h264_pred_weight_table(), parse_slice_header(), and slice_type().

## ◆ sps_scaling_list_fallback()

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

References default_4x4_inter, default_4x4_intra, default_8x8_inter, default_8x8_intra, seq_parameter_set_rbsp::scaling_lists_4x4, seq_parameter_set_rbsp::scaling_lists_8x8, zigzag_4x4, and zigzag_8x8.

Referenced by parse_sps().

## ◆ vdpau_decoder_init()

static int vdpau_decoder_init | ( | video_decoder_t * | this_gen | ) |
| static

References _x_meta_info_set_utf8(), _x_stream_info_set(), vo_frame_s::accel_data, xine_format_change_data_t::aspect, vo_frame_s::free, height, xine_format_change_data_t::height, NULL, set_ratio(), VO_BOTH_FIELDS, width, xine_format_change_data_t::width, XINE_EVENT_FRAME_FORMAT_CHANGE, xine_event_send(), XINE_IMGFMT_VDPAU, XINE_META_INFO_VIDEOCODEC, XINE_STREAM_INFO_FRAME_DURATION, XINE_STREAM_INFO_VIDEO_HEIGHT, XINE_STREAM_INFO_VIDEO_RATIO, XINE_STREAM_INFO_VIDEO_WIDTH, XINE_VERBOSITY_LOG, and xprintf.

Referenced by vdpau_h264_decode_data().

## ◆ vdpau_decoder_render()

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

References vo_frame_s::accel_data, vo_frame_s::bad_frame, CAST_VdpPictureInfo_PTR, seq_parameter_set_rbsp::colour_description_present, decoded_pic_add_field(), dpb_add_picture(), dpb_flush(), dpb_unmark_picture_delayed(), dpb_unmark_reference_picture(), draw_frames(), vo_frame_s::duration, slice_header::field_pic_flag, fill_vdpau_pictureinfo_h264(), free_coded_picture(), IDR_PIC, decoded_picture::img, init_decoded_picture(), lock_decoded_picture(), seq_parameter_set_rbsp::matrix_coefficients, NULL, seq_parameter_set_rbsp::num_ref_frames, seq_parameter_set_rbsp::num_units_in_tick, process_mmc_operations(), vo_frame_s::progressive_frame, vo_frame_s::pts, release_decoded_picture(), vo_frame_s::repeat_first_field, seq_parameter_set_rbsp::time_scale, seq_parameter_set_rbsp::timing_info_present_flag, vdpau_h264_reset(), seq_parameter_set_rbsp::video_full_range_flag, seq_parameter_set_rbsp::video_signal_type_present_flag, VO_BOTH_FIELDS, VO_SET_FLAGS_CM, seq_parameter_set_rbsp::vui_parameters, seq_parameter_set_rbsp::vui_parameters_present_flag, XINE_IMGFMT_VDPAU, XINE_VERBOSITY_DEBUG, XINE_VERBOSITY_LOG, and xprintf.

Referenced by vdpau_h264_decode_data().

## ◆ vdpau_h264_decode_data()

static void vdpau_h264_decode_data | ( | video_decoder_t * | this_gen,
|  | buf_element_t * | buf )
| static

References _x_stream_info_set(), xine_bmiheader::biHeight, xine_bmiheader::biSize, xine_bmiheader::biWidth, BUF_FLAG_FRAME_END, BUF_FLAG_FRAME_START, BUF_FLAG_FRAMERATE, BUF_FLAG_PREVIEW, BUF_FLAG_SPECIAL, BUF_FLAG_STDHEADER, BUF_SPECIAL_DECODER_CONFIG, BUF_SPECIAL_PALETTE, buf_element_s::content, buf_element_s::decoder_flags, buf_element_s::decoder_info, buf_element_s::decoder_info_ptr, free_coded_picture(), height, NULL, parse_codec_private(), parse_frame(), buf_element_s::pts, buf_element_s::size, vdpau_decoder_init(), vdpau_decoder_render(), vdpau_h264_flush(), width, XINE_STREAM_INFO_FRAME_DURATION, XINE_VERBOSITY_DEBUG, XINE_VERBOSITY_LOG, and xprintf.

Referenced by open_plugin().

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

References dpb_free_all(), free_parser(), NULL, and release_decoded_picture().

Referenced by open_plugin().

## ◆ vdpau_h264_flush()

static void vdpau_h264_flush | ( | video_decoder_t * | this_gen | ) |
| static

References dpb_free_all(), draw_frames(), NULL, release_decoded_picture(), and VO_NEW_SEQUENCE_FLAG.

Referenced by open_plugin(), and vdpau_h264_decode_data().

## ◆ vdpau_h264_reset()

static void vdpau_h264_reset | ( | video_decoder_t * | this_gen | ) |
| static

References dpb_free_all(), free_parser(), init_parser(), NULL, parse_codec_private(), release_decoded_picture(), and VO_NEW_SEQUENCE_FLAG.

Referenced by open_plugin(), and vdpau_decoder_render().

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