It’s your lucky day today Gleard (or anyone else interested)!
I’ve made a demonstation source code to show others how to use edc_ecc from the open source cdrtools (cdrecord) to encode CD+G P & Q RS codes.
Download from here:
The decode functions only calculate syndromes (number of errors) and doesn’t do error correction.
A bug was fixed in the original code, see inside rs_codes.cpp:
int encode_LSUB_Q(unsigned char * inout)