static void seqvideo_decode(SeqVideoContext *seq, const unsigned char *data, int data_size)
{
    GetBitContext gb;
    int flags, i, j, x, y, op;
    unsigned char c[3];
    unsigned char *dst;
    flags = *data++;
    if (flags & 1) {
        for (i = 0; i < 256; i++) {
            for (j = 0; j < 3; j++, data++)
                c[j] = (*data << 2) | (*data >> 4);
            seq->palette[i] = AV_RB24(c);
        }
        memcpy(seq->frame.data[1], seq->palette, sizeof(seq->palette));
        seq->frame.palette_has_changed = 1;
    }
    if (flags & 2) {
        init_get_bits(&gb, data, 128 * 8); data += 128;
        for (y = 0; y < 128; y += 8)
            for (x = 0; x < 256; x += 8) {
                dst = &seq->frame.data[0][y * seq->frame.linesize[0] + x];
                op = get_bits(&gb, 2);
                switch (op) {
                case 1:
                    data = seq_decode_op1(seq, data, dst);
                    break;
                case 2:
                    data = seq_decode_op2(seq, data, dst);
                    break;
                case 3:
                    data = seq_decode_op3(seq, data, dst);
                    break;
                }
            }
    }
}
['static void seqvideo_decode(SeqVideoContext *seq, const unsigned char *data, int data_size)\n{\n    GetBitContext gb;\n    int flags, i, j, x, y, op;\n    unsigned char c[3];\n    unsigned char *dst;\n    flags = *data++;\n    if (flags & 1) {\n        for (i = 0; i < 256; i++) {\n            for (j = 0; j < 3; j++, data++)\n                c[j] = (*data << 2) | (*data >> 4);\n            seq->palette[i] = AV_RB24(c);\n        }\n        memcpy(seq->frame.data[1], seq->palette, sizeof(seq->palette));\n        seq->frame.palette_has_changed = 1;\n    }\n    if (flags & 2) {\n        init_get_bits(&gb, data, 128 * 8); data += 128;\n        for (y = 0; y < 128; y += 8)\n            for (x = 0; x < 256; x += 8) {\n                dst = &seq->frame.data[0][y * seq->frame.linesize[0] + x];\n                op = get_bits(&gb, 2);\n                switch (op) {\n                case 1:\n                    data = seq_decode_op1(seq, data, dst);\n                    break;\n                case 2:\n                    data = seq_decode_op2(seq, data, dst);\n                    break;\n                case 3:\n                    data = seq_decode_op3(seq, data, dst);\n                    break;\n                }\n            }\n    }\n}']