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

Function copy_bits

libavcodec/wmavoice.c:1892–1908  ·  view source on GitHub ↗

* Copy (unaligned) bits from gb/data/size to pb. * * @param pb target buffer to copy bits into * @param data source buffer to copy bits from * @param size size of the source data, in bytes * @param gb bit I/O context specifying the current position in the source. * data. This function might use this to align the bit position to * a whole-byte boundary before calling #ff_

Source from the content-addressed store, hash-verified

1890 * I/O context is undefined.
1891 */
1892static void copy_bits(PutBitContext *pb,
1893 const uint8_t *data, int size,
1894 GetBitContext *gb, int nbits)
1895{
1896 int rmn_bytes, rmn_bits;
1897
1898 rmn_bits = rmn_bytes = get_bits_left(gb);
1899 if (rmn_bits < nbits)
1900 return;
1901 if (nbits > put_bits_left(pb))
1902 return;
1903 rmn_bits &= 7; rmn_bytes >>= 3;
1904 if ((rmn_bits = FFMIN(rmn_bits, nbits)) > 0)
1905 put_bits(pb, rmn_bits, get_bits(gb, rmn_bits));
1906 ff_copy_bits(pb, data + size - rmn_bytes,
1907 FFMIN(nbits - rmn_bits, rmn_bytes << 3));
1908}
1909
1910/**
1911 * Packet decoding: a packet is anything that the (ASF) demuxer contains,

Callers 1

wmavoice_decode_packetFunction · 0.70

Calls 5

get_bits_leftFunction · 0.85
put_bits_leftFunction · 0.85
ff_copy_bitsFunction · 0.85
put_bitsFunction · 0.70
get_bitsFunction · 0.70

Tested by

no test coverage detected