/* Returns the next nibble in sequence, consuming a new byte on the input only if necessary.  */
static uint8_t yop_get_next_nibble(YopDecContext *s)
/* Returns the next nibble in sequence, consuming a new byte on the input only if necessary.  */
static uint8_t yop_get_next_nibble(YopDecContext *s)
{
    int ret;
    if (s->low_nibble) {
        ret           = *s->low_nibble & 0xf;
        s->low_nibble = NULL;
    }else {
        s->low_nibble = s->srcptr++;
        ret           = *s->low_nibble >> 4;
    }
    return ret;
}