avcodec/hapdec : reorganize code before adding multi-texture decoding