static void radix_sort_pass(RCCMPEntry *dst, const RCCMPEntry *data,
                            int size, int buckets[NBUCKETS], int pass)
{
    int shift = pass * BUCKET_BITS;
    int i;
    for (i = 0; i < size; i++) {
        int v   = get_bucket(data[i].value, shift);
        int pos = buckets[v]++;
        dst[pos] = data[i];
    }
}
['static void radix_sort(RCCMPEntry *data, int size)\n{\n    int buckets[RADIX_PASSES][NBUCKETS];\n    RCCMPEntry *tmp = av_malloc(sizeof(*tmp) * size);\n    radix_count(data, size, buckets);\n    radix_sort_pass(tmp, data, size, buckets[0], 0);\n    radix_sort_pass(data, tmp, size, buckets[1], 1);\n    if (buckets[2][NBUCKETS - 1] || buckets[3][NBUCKETS - 1]) {\n        radix_sort_pass(tmp, data, size, buckets[2], 2);\n        radix_sort_pass(data, tmp, size, buckets[3], 3);\n    }\n    av_free(tmp);\n}', 'static void radix_sort_pass(RCCMPEntry *dst, const RCCMPEntry *data,\n                            int size, int buckets[NBUCKETS], int pass)\n{\n    int shift = pass * BUCKET_BITS;\n    int i;\n    for (i = 0; i < size; i++) {\n        int v   = get_bucket(data[i].value, shift);\n        int pos = buckets[v]++;\n        dst[pos] = data[i];\n    }\n}', 'static inline int get_bucket(int value, int shift)\n{\n    value >>= shift;\n    value  &= NBUCKETS - 1;\n    return NBUCKETS - 1 - value;\n}']