avcodec/libopenjpegenc: fix mixed declarations and code