34 if (*mqc->
bp == 0xff){
36 *mqc->
bp = mqc->
c >> 20;
39 }
else if ((mqc->
c & 0x8000000)){
45 *mqc->
bp = mqc->
c >> 19;
58 }
while (!(mqc->
a & 0x8000));
63 int tmp = mqc->
c + mqc->
a;
76 mqc->
ct = 12 + (*mqc->
bp == 0xff);
85 if ((*cxstate & 1) == d){
86 if (!(mqc->
a & 0x8000)){
113 mqc->
c = mqc->
c << mqc->
ct;
115 mqc->
c = mqc->
c << mqc->
ct;
117 if (*mqc->
bp != 0xff)
129 *dst_len = mqc2.
bp - dst;
135 memmove(dst, dst+1, *dst_len);
136 return mqc->
bp - mqc->
bpstart + 1 + *dst_len;
138 return mqc->
bp - mqc->
bpstart + *dst_len;
int ff_mqc_length(MqcState *mqc)
number of encoded bytes
void ff_mqc_init_contexts(MqcState *mqc)
MQ-coder context initialisations.
void ff_mqc_encode(MqcState *mqc, uint8_t *cxstate, int d)
code bit d with context cx
int ff_mqc_flush(MqcState *mqc)
flush the encoder [returns number of bytes encoded]
uint16_t ff_mqc_qe[2 *47]
void ff_mqc_initenc(MqcState *mqc, uint8_t *bp)
initialize the encoder
simple assert() macros that are a bit more flexible than ISO C assert().
int ff_mqc_flush_to(MqcState *mqc, uint8_t *dst, int *dst_len)
#define av_assert1(cond)
assert() equivalent, that does not lie in speed critical code.
uint8_t ff_mqc_nlps[2 *47]
static void setbits(MqcState *mqc)
uint8_t ff_mqc_nmps[2 *47]
static void byteout(MqcState *mqc)
static void renorme(MqcState *mqc)