Joint content and shape adaptive transforms based on a GMRF model for coding arbitrary-shaped image segments