mqc_dec_inl.h File Reference

Go to the source code of this file.

## Macros

#define | mpsexchange_dec_macro(d, curctx, a)
#define | lpsexchange_dec_macro(d, curctx, a)
#define | bytein_dec_macro(mqc, c, ct)
#define | renorm_dec_macro(mqc, a, c, ct)
#define | decompress_macro(d, mqc, curctx, a, c, ct)
#define | mqc_renormd(mqc) renorm_dec_macro(mqc, mqc->a, mqc->c, mqc->ct)
| Renormalize mqc->a and mqc->c while decoding.
#define | mqc_decode(d, mqc) decompress_macro(d, mqc, mqc->curctx, mqc->a, mqc->c, mqc->ct)
| Decompress a symbol.

## Functions

static INLINE uint32_t | mqc_raw_decode (mqcoder *mqc)
| Decompress a symbol using raw-decoder.
static INLINE void | mqc_bytein (mqcoder *const mqc)
| Input a byte.

## Macro Definition Documentation

## bytein_dec_macro

#define bytein_dec_macro | ( |  | mqc,
|  |  | c,
|  |  | ct
| ) |  |

Value:
{ \
/* Given mqc_init_dec() we know that at some point we will */ \
/* have a 0xFF 0xFF artificial marker */ \
uint32_t l_c = *(mqc->bp + 1); \
if(*mqc->bp == 0xff) \
{ \
if(l_c > 0x8f) \
{ \
c += 0xff00; \
ct = 8; \
mqc->end_of_byte_stream_counter++; \
} \
else \
{ \
mqc->bp++; \
c += l_c << 9; \
ct = 7; \
} \
} \
else \
{ \
mqc->bp++; \
c += l_c << 8; \
ct = 8; \
} \
}

## decompress_macro

#define decompress_macro | ( |  | d,
|  |  | mqc,
|  |  | curctx,
|  |  | a,
|  |  | c,
|  |  | ct
| ) |  |

Value:
{ \
/* Implements ISO 15444-1 C.3.2 Decompressing a decision (DECODE) */ \
a -= (*curctx)->qeval; \
uint32_t qeval_shift = (*curctx)->qeval << 16; \
if(c < qeval_shift) \
{ \
lpsexchange_dec_macro(d, curctx, a); \
renorm_dec_macro(mqc, a, c, ct); \
} \
else \
{ \
c -= qeval_shift; \
if(a < A_MIN) \
{ \
mpsexchange_dec_macro(d, curctx, a); \
renorm_dec_macro(mqc, a, c, ct); \
} \
else \
{ \
d = (*curctx)->mps; \
} \
} \
}
hwy::HWY_NAMESPACE::d
d
Definition rvv-inl.h:1998

## lpsexchange_dec_macro

#define lpsexchange_dec_macro | ( |  | d,
|  |  | curctx,
|  |  | a
| ) |  |

Value:
{ \
if(a < (*curctx)->qeval) \
{ \
a = (*curctx)->qeval; \
d = (*curctx)->mps; \
*curctx = (*curctx)->nmps; \
} \
else \
{ \
a = (*curctx)->qeval; \
d = (*curctx)->mps ^ 1; \
*curctx = (*curctx)->nlps; \
} \
}

## mpsexchange_dec_macro

#define mpsexchange_dec_macro | ( |  | d,
|  |  | curctx,
|  |  | a
| ) |  |

Value:
{ \
if(a < (*curctx)->qeval) \
{ \
d = (*curctx)->mps ^ 1; \
*curctx = (*curctx)->nlps; \
} \
else \
{ \
d = (*curctx)->mps; \
*curctx = (*curctx)->nmps; \
} \
}

## mqc_decode

#define mqc_decode | ( |  | d,
|  |  | mqc
| ) |  | decompress_macro(d, mqc, mqc->curctx, mqc->a, mqc->c, mqc->ct)

Decompress a symbol.

Parameters

  d | uint32_t value where to store the decoded symbol
  mqc | MQC handle

Returns
  Returns the decoded symbol (0 or 1) in d

## mqc_renormd

#define mqc_renormd | ( |  | mqc | ) | renorm_dec_macro(mqc, mqc->a, mqc->c, mqc->ct)

Renormalize mqc->a and mqc->c while decoding.

Parameters

  mqc | MQC handle

## renorm_dec_macro

#define renorm_dec_macro | ( |  | mqc,
|  |  | a,
|  |  | c,
|  |  | ct
| ) |  |

Value:
{ \
do \
{ \
if(ct == 0) \
bytein_dec_macro(mqc, c, ct); \
a <<= 1; \
c <<= 1; \
ct--; \
} while(a < A_MIN); \
}

## Function Documentation

## mqc_bytein()

static INLINE void mqc_bytein | ( | mqcoder *const | mqc | ) |

static

Input a byte.

Parameters

  mqc | MQC handle

References bytein_dec_macro.

Referenced by grk::mqc_init_dec().

## mqc_raw_decode()

static INLINE uint32_t mqc_raw_decode | ( | mqcoder * | mqc | ) |

static

Decompress a symbol using raw-decoder.

Cfr p.506 TAUBMAN

Parameters

  mqc | MQC handle

Returns
  Returns the decoded symbol (0 or 1)

Referenced by grk::T1::dec_refpass_step_raw(), and grk::T1::dec_sigpass_step_raw().