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

Function copy_bits

libavcodec/wmavoice.c:1868–1882  ·  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

1866 * I/O context is undefined.
1867 */
1868static void copy_bits(PutBitContext *pb,
1869 const uint8_t *data, int size,
1870 GetBitContext *gb, int nbits)
1871{
1872 int rmn_bytes, rmn_bits;
1873
1874 rmn_bits = rmn_bytes = get_bits_left(gb);
1875 if (rmn_bits < nbits)
1876 return;
1877 rmn_bits &= 7; rmn_bytes >>= 3;
1878 if ((rmn_bits = FFMIN(rmn_bits, nbits)) > 0)
1879 put_bits(pb, rmn_bits, get_bits(gb, rmn_bits));
1880 ff_copy_bits(pb, data + size - rmn_bytes,
1881 FFMIN(nbits - rmn_bits, rmn_bytes << 3));
1882}
1883
1884/**
1885 * Packet decoding: a packet is anything that the (ASF) demuxer contains,

Callers 1

wmavoice_decode_packetFunction · 0.70

Calls 3

get_bits_leftFunction · 0.85
get_bitsFunction · 0.85
ff_copy_bitsFunction · 0.85

Tested by

no test coverage detected