MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / init_get_bits

Function init_get_bits

libavcodec/get_bits.h:517–534  ·  view source on GitHub ↗

* Initialize GetBitContext. * @param buffer bitstream buffer, must be AV_INPUT_BUFFER_PADDING_SIZE bytes * larger than the actual read bits because some optimized bitstream * readers read 32 or 64 bit at once and could read over the end * @param bit_size the size of the buffer in bits * @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow. */

Source from the content-addressed store, hash-verified

515 * @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow.
516 */
517static inline int init_get_bits(GetBitContext *s, const uint8_t *buffer,
518 int bit_size)
519{
520 int ret = 0;
521
522 if (bit_size >= INT_MAX - FFMAX(7, AV_INPUT_BUFFER_PADDING_SIZE*8) || bit_size < 0 || !buffer) {
523 bit_size = 0;
524 buffer = NULL;
525 ret = AVERROR_INVALIDDATA;
526 }
527
528 s->buffer = buffer;
529 s->size_in_bits = bit_size;
530 s->size_in_bits_plus8 = bit_size + 8;
531 s->index = 0;
532
533 return ret;
534}
535
536/**
537 * Initialize GetBitContext.

Callers 15

mov_read_ddtsFunction · 0.85
mov_read_stszFunction · 0.85
rtp_parse_mp4_auFunction · 0.85
dts_probeFunction · 0.85
parse_fmtp_configFunction · 0.85
ff_rtp_send_h263_rfc2190Function · 0.85
read_sl_headerFunction · 0.85
theora_headerFunction · 0.85
write_packetFunction · 0.85
h263_handle_packetFunction · 0.85
parse_sequence_headerFunction · 0.85
h261_handle_packetFunction · 0.85

Calls

no outgoing calls

Tested by 1

mainFunction · 0.68