I looked at the GIMP source code but I could not
find the
relevant parts of the code. Could you please tell me in what files the relevant parts of the code are?
It's possible to perform scaling by two means. If invoked from the Scale Image menu entry, the affected code is in app/paint-funcs/paint- funcs.c as Simon already pointed out. If invoked via the Scale tool, then it's the code in app/core/gimpdrawable-transform.c the one in effect.
Note, however, that the code in paint-funcs.c does not implement cubic resampling when scaling down.
-- Pedro Gimeno