There was a brief spell during the shooting of Warner Bros.’ “The Departed” when Martin Scorsese may have regretted giving Mark Wahlberg and Matt Damon the OK to improvise some Boston street lingo.

“We tried to come up with the most obscure slang that nobody else would understand,” recalls Wahlberg, who reached critical mass in 1997 as porn star Dirk Diggler in Paul Thomas Anderson’s “Boogie Nights” — a performance many believed was Oscar worthy. “At one point, we were doing this one exchange and Marty said he might have to use subtitles because if he didn’t get it, the rest of the country wouldn’t, either.”

It seems most of the country got it, as evidenced by the $113 million box office take of the gritty crime drama so far. Part of the reason is the stellar cast, which includes Wahlberg, Damon, Leonardo DiCaprio and Jack Nicholson. But there’s also an authenticity that Scorsese and screenwriter William Monahan created, and that Boston natives such as Wahlberg and Damon ran with.

“Bill is from that area,” explains Wahlberg. “The busing strike that the movie starts with was something definitely very clear in my memory. My dad was a Teamster, and (Monahan) did a great job of capturing that world. After ‘Mystic River’ and now this movie, people are realizing there are a lot of interesting stories to be had in that neck of the woods, as there have been in New York City.”

Wahlberg plays a foul-mouthed detective named Dignam, who is constantly riding DiCaprio and getting into the faces of anyone who challenges him.

“Marty encouraged me to push the envelope, especially in scenes with the other guys,” Wahlberg says. “He wanted me to pretty much push them over the edge. After a take, he would ask if everybody was all right. Then he’d whisper for me to do a little more. I loved that.”

While Wahlberg interacts often in the film with Damon and DiCaprio, he only has one scene with Nicholson.

“I certainly wish I could have done more with Jack,” he says. “There was a lot going on. It was one of those movies where a lot of things could have ended up on the editing room floor. But only one line in the scene with Jack was cut out, so that’s good. At the end of the day, it’s about servicing Marty.”

Nicholson’s character, Frank Costello, is believed to be a thinly veiled depiction of real-life South Boston mobster Whitey Bulger, who disappeared almost 12 years ago and is still being hunted by authorities.

“Whitey was one of the most recognizable names in Boston,” Wahlberg says, “right up there with Paul Revere. While I was watching the movie, I was wondering where Whitey was when he saw the movie. I’m sure he’s seen it.”

Favorite film of the past five years: ” ‘Borat.’ I saw a 1 o’clock show the day it came out. The first thing that happened is that the trailer for Mel Gibson’s movie came out and everybody booed. I can’t remember the last time I experienced a movie where the audience interacted like that. And I also can’t remember seeing a movie that I wanted to see a second time right away.”

Actor who impressed you greatly after working together: “Robert Duvall. I just worked with him on ‘We Own the Night.’ He played my dad. He looks like my dad and acts like my dad. In a lot of ways, he felt like my dad. Obviously, the guy’s one of the best of his generation. Everything he does just seems to ring complete honesty and truth.”

Next project: “I’m doing a film called ‘Shooter,’ by Antoine Fuqua. That’s another amazing experience. I’ve been very fortunate lately to make movies I not only want to be in but want to see. I was a little frustrated at first, but now I’m completely jazzed.”