xine-lib: xine-lib-1.2.13/src/video_dec/libmpeg2new/libmpeg2/decode.c File Reference

xine-lib 1.2.13-20230125hg15249

Macros | Functions | Variables
decode.c File Reference
`#include "config.h"`
`#include <string.h>`
`#include <stdlib.h>`
`#include <inttypes.h>`
`#include "../include/mpeg2.h"`
`#include "../include/attributes.h"`
`#include "mpeg2_internal.h"`

## Macros
#define | BUFFER_SIZE (1194 * 1024)
#define | RECEIVED(code, state) (((state) << 8) + (code))

## Functions
const mpeg2_info_t * | mpeg2_info (mpeg2dec_t *mpeg2dec)
static int | skip_chunk (mpeg2dec_t *mpeg2dec, int bytes)
static int | copy_chunk (mpeg2dec_t *mpeg2dec, int bytes)
void | mpeg2_buffer (mpeg2dec_t *mpeg2dec, uint8_t *start, uint8_t *end)
int | mpeg2_getpos (mpeg2dec_t *mpeg2dec)
static mpeg2_state_t | seek_chunk (mpeg2dec_t *mpeg2dec)
mpeg2_state_t | mpeg2_seek_header (mpeg2dec_t *mpeg2dec)
mpeg2_state_t | mpeg2_parse (mpeg2dec_t *mpeg2dec)
mpeg2_state_t | mpeg2_parse_header (mpeg2dec_t *mpeg2dec)
int | mpeg2_convert (mpeg2dec_t *mpeg2dec, mpeg2_convert_t convert, void *arg)
int | mpeg2_stride (mpeg2dec_t *mpeg2dec, int stride)
void | mpeg2_set_buf (mpeg2dec_t *mpeg2dec, uint8_t *buf[3], void *id)
void | mpeg2_custom_fbuf (mpeg2dec_t *mpeg2dec, int custom_fbuf)
void | mpeg2_skip (mpeg2dec_t *mpeg2dec, int skip)
void | mpeg2_slice_region (mpeg2dec_t *mpeg2dec, int start, int end)
void | mpeg2_tag_picture (mpeg2dec_t *mpeg2dec, uint32_t tag, uint32_t tag2)
uint32_t | mpeg2_accel (uint32_t accel)
void | mpeg2_reset (mpeg2dec_t *mpeg2dec, int full_reset)
mpeg2dec_t * | mpeg2_init (void)
void | mpeg2_close (mpeg2dec_t *mpeg2dec)

## Variables
static int | mpeg2_accels = 0

## Macro Definition Documentation

## ◆ BUFFER_SIZE

#define BUFFER_SIZE (1194 * 1024)

## ◆ RECEIVED

#define RECEIVED | ( |  | code,
|  |  | state ) (((state) << 8) + (code))

Referenced by mpeg2_parse_header().

## Function Documentation

## ◆ copy_chunk()

static int copy_chunk | ( | mpeg2dec_t * | mpeg2dec,
|  | int | bytes )
| inlinestatic

References mpeg2dec_s::buf_start, mpeg2dec_s::chunk_ptr, and mpeg2dec_s::shift.

## ◆ mpeg2_accel()

uint32_t mpeg2_accel | ( | uint32_t | accel | ) |

References MPEG2_ACCEL_DETECT, mpeg2_accels, mpeg2_cpu_state_init(), mpeg2_detect_accel(), mpeg2_idct_init(), and mpeg2_mc_init().

Referenced by mpeg2_init().

## ◆ mpeg2_buffer()

void mpeg2_buffer | ( | mpeg2dec_t * | mpeg2dec,
|  | uint8_t * | start,
|  | uint8_t * | end )

References mpeg2dec_s::buf_end, and mpeg2dec_s::buf_start.

Referenced by mpeg2_video_decode_data().

## ◆ mpeg2_close()

void mpeg2_close | ( | mpeg2dec_t * | mpeg2dec | ) |

References mpeg2dec_s::chunk_buffer, mpeg2_free(), and mpeg2_header_state_init().

## ◆ mpeg2_convert()

int mpeg2_convert | ( | mpeg2dec_t * | mpeg2dec,
|  | mpeg2_convert_t | convert,
|  | void * | arg )

References mpeg2dec_s::convert, mpeg2dec_s::convert_arg, mpeg2dec_s::convert_id_size, mpeg2dec_s::convert_stride, mpeg2_convert_init_s::id_size, mpeg2_accels, MPEG2_CONVERT_SET, NULL, and mpeg2dec_s::sequence.

## ◆ mpeg2_custom_fbuf()

void mpeg2_custom_fbuf | ( | mpeg2dec_t * | mpeg2dec,
|  | int | custom_fbuf )

References mpeg2dec_s::custom_fbuf.

Referenced by open_plugin().

## ◆ mpeg2_getpos()

int mpeg2_getpos | ( | mpeg2dec_t * | mpeg2dec | ) |

References mpeg2dec_s::buf_end, and mpeg2dec_s::buf_start.

## ◆ mpeg2_info()

const mpeg2_info_t * mpeg2_info | ( | mpeg2dec_t * | mpeg2dec | ) |

References mpeg2dec_s::info.

Referenced by mpeg2_video_decode_data(), and mpeg2_video_reset().

## ◆ mpeg2_init()

mpeg2dec_t * mpeg2_init | ( | void |  | ) |

References BUFFER_SIZE, mpeg2dec_s::chunk_buffer, mpeg2_decoder_s::DCTblock, mpeg2dec_s::decoder, mpeg2_accel(), MPEG2_ACCEL_DETECT, MPEG2_ALLOC_CHUNK, MPEG2_ALLOC_MPEG2DEC, mpeg2_malloc(), mpeg2_reset(), NULL, mpeg2dec_s::quantizer_matrix, mpeg2dec_s::sequence, and mpeg2_sequence_s::width.

Referenced by open_plugin(), and open_plugin().

## ◆ mpeg2_parse()

mpeg2_state_t mpeg2_parse | ( | mpeg2dec_t * | mpeg2dec | ) |

References mpeg2dec_s::action, mpeg2dec_s::buf_end, mpeg2dec_s::buf_start, BUFFER_SIZE, mpeg2dec_s::bytes_since_tag, mpeg2dec_s::chunk_buffer, mpeg2dec_s::chunk_ptr, mpeg2dec_s::chunk_start, mpeg2dec_s::code, copy_chunk(), mpeg2dec_s::decoder, mpeg2dec_s::first_decode_slice, mpeg2_seek_header(), mpeg2_slice(), mpeg2dec_s::nb_decode_slices, seek_chunk(), mpeg2dec_s::state, STATE_BUFFER, STATE_INTERNAL_NORETURN, STATE_INVALID, and STATE_SLICE.

Referenced by mpeg2_video_decode_data(), and mpeg2_video_reset().

## ◆ mpeg2_parse_header()

mpeg2_state_t mpeg2_parse_header | ( | mpeg2dec_t * | mpeg2dec | ) |

References mpeg2dec_s::action, mpeg2dec_s::buf_end, mpeg2dec_s::buf_start, BUFFER_SIZE, mpeg2dec_s::bytes_since_tag, mpeg2dec_s::chunk_buffer, mpeg2dec_s::chunk_ptr, mpeg2dec_s::chunk_start, mpeg2dec_s::code, copy_chunk(), mpeg2dec_s::info, mpeg2_accels, mpeg2_header_extension(), mpeg2_header_gop(), mpeg2_header_gop_finalize(), mpeg2_header_picture(), mpeg2_header_picture_finalize(), mpeg2_header_sequence(), mpeg2_header_sequence_finalize(), mpeg2_header_slice_start(), mpeg2_header_user_data(), mpeg2_parse_header(), mpeg2_seek_header(), NULL, process_header(), RECEIVED, mpeg2dec_s::state, STATE_BUFFER, STATE_GOP, STATE_INVALID, STATE_PICTURE, STATE_PICTURE_2ND, STATE_SEQUENCE, mpeg2_info_s::user_data, mpeg2_info_s::user_data_len, and mpeg2dec_s::user_data_len.

Referenced by mpeg2_parse_header(), and mpeg2_seek_header().

## ◆ mpeg2_reset()

void mpeg2_reset | ( | mpeg2dec_t * | mpeg2dec,
|  | int | full_reset )

References mpeg2dec_s::action, mpeg2dec_s::buf_end, mpeg2dec_s::buf_start, mpeg2dec_s::code, mpeg2dec_s::first, mpeg2_info_s::gop, mpeg2dec_s::info, mpeg2_header_state_init(), mpeg2_reset_info(), mpeg2_seek_header(), NULL, mpeg2dec_s::num_tags, mpeg2_info_s::sequence, mpeg2dec_s::shift, mpeg2dec_s::state, STATE_INVALID, mpeg2_info_s::user_data, and mpeg2_info_s::user_data_len.

## ◆ mpeg2_seek_header()

mpeg2_state_t mpeg2_seek_header | ( | mpeg2dec_t * | mpeg2dec | ) |

References mpeg2dec_s::chunk_buffer, mpeg2dec_s::chunk_ptr, mpeg2dec_s::chunk_start, mpeg2dec_s::code, mpeg2_header_end(), mpeg2_parse_header(), seek_chunk(), mpeg2dec_s::sequence, STATE_BUFFER, mpeg2dec_s::user_data_len, and mpeg2_sequence_s::width.

Referenced by invalid_end_action(), mpeg2_parse(), mpeg2_parse_header(), mpeg2_reset(), and seek_sequence().

## ◆ mpeg2_set_buf()

void mpeg2_set_buf | ( | mpeg2dec_t * | mpeg2dec,
|  | uint8_t * | buf[3],
|  | void * | id )

References mpeg2dec_s::alloc_index, mpeg2dec_s::alloc_index_user, mpeg2_fbuf_s::buf, mpeg2_decoder_s::coding_type, mpeg2dec_s::custom_fbuf, mpeg2dec_s::decoder, fbuf_alloc_t::fbuf, mpeg2dec_s::fbuf, mpeg2dec_s::fbuf_alloc, mpeg2_fbuf_s::id, mpeg2_set_fbuf(), PIC_FLAG_CODING_TYPE_B, mpeg2dec_s::state, and STATE_SEQUENCE.

Referenced by mpeg2_video_decode_data().

## ◆ mpeg2_skip()

void mpeg2_skip | ( | mpeg2dec_t * | mpeg2dec,
|  | int | skip )

References mpeg2dec_s::first_decode_slice, and mpeg2dec_s::nb_decode_slices.

## ◆ mpeg2_slice_region()

void mpeg2_slice_region | ( | mpeg2dec_t * | mpeg2dec,
|  | int | start,
|  | int | end )

References mpeg2dec_s::first_decode_slice, and mpeg2dec_s::nb_decode_slices.

## ◆ mpeg2_stride()

int mpeg2_stride | ( | mpeg2dec_t * | mpeg2dec,
|  | int | stride )

References mpeg2dec_s::convert, mpeg2dec_s::convert_arg, mpeg2dec_s::convert_id_size, mpeg2dec_s::convert_stride, mpeg2dec_s::decoder, mpeg2_convert_init_s::id_size, mpeg2_accels, MPEG2_CONVERT_STRIDE, NULL, mpeg2dec_s::sequence, mpeg2_decoder_s::stride_frame, and mpeg2_sequence_s::width.

## ◆ mpeg2_tag_picture()

void mpeg2_tag_picture | ( | mpeg2dec_t * | mpeg2dec,
|  | uint32_t | tag,
|  | uint32_t | tag2 )

References mpeg2dec_s::bytes_since_tag, mpeg2dec_s::num_tags, mpeg2dec_s::tag2_current, mpeg2dec_s::tag2_previous, mpeg2dec_s::tag_current, and mpeg2dec_s::tag_previous.

## ◆ seek_chunk()

static mpeg2_state_t seek_chunk | ( | mpeg2dec_t * | mpeg2dec | ) |
| inlinestatic

References mpeg2dec_s::buf_end, mpeg2dec_s::buf_start, mpeg2dec_s::bytes_since_tag, mpeg2dec_s::code, skip_chunk(), STATE_BUFFER, and STATE_INTERNAL_NORETURN.

Referenced by mpeg2_parse(), and mpeg2_seek_header().

## ◆ skip_chunk()

static int skip_chunk | ( | mpeg2dec_t * | mpeg2dec,
|  | int | bytes )
| inlinestatic

References mpeg2dec_s::buf_start, and mpeg2dec_s::shift.

Referenced by seek_chunk().

## Variable Documentation

## ◆ mpeg2_accels

int mpeg2_accels = 0
| static

Referenced by mpeg2_accel(), mpeg2_convert(), mpeg2_parse_header(), and mpeg2_stride().