xref: /aosp_15_r20/external/mesa3d/src/intel/tools/error_decode_lib.c (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1 /*
2  * Copyright 2024 Intel Corporation
3  * SPDX-License-Identifier: MIT
4  */
5 
6 #include "error_decode_lib.h"
7 
8 const char *
ascii85_decode_char(const char * in,uint32_t * v)9 ascii85_decode_char(const char *in, uint32_t *v)
10 {
11    *v = 0;
12 
13    if (*in == 'z') {
14       in++;
15    } else {
16       *v += in[0] - 33; *v *= 85;
17       *v += in[1] - 33; *v *= 85;
18       *v += in[2] - 33; *v *= 85;
19       *v += in[3] - 33; *v *= 85;
20       *v += in[4] - 33;
21       in += 5;
22    }
23 
24    return in;
25 }
26