“Whiplash” is “An Officer and a Gentleman” set to jazz, although there are moments when a comparison to “Full Metal Jacket” seems more apropos.

All three films feature intense, abusive, charismatic mentors who would scoff at the term “tough love” as being far too cuddly and soft to describe their technique. As the terrifying, unapologetic jazz maestro Terence Fletcher (J.K. Simmons) in “Whiplash” says to one former student, “There are no two words in the English language more harmful than, ‘Good job.’ ”

“Whiplash” is written and directed by Damien Chazelle, who is not yet 30 years old. It would be an insult to call Chazelle a “promising” filmmaker, as this movie doesn’t indicate mere potential — it is evidence of authentic, sometimes blazing talent.

At times the confrontations between teacher and pupil in “Whiplash” are so intense, and the cruelty the instructor inflicts on his students is so fierce, it is difficult to watch. One feels enervated. And then the music comes together, and the moment soars, and the result is nothing short of exhilarating. This is one of those rare films where we feel as if we’re really there with the protagonist every step of the way.

Miles Teller (“The Spectacular Now”) is Andrew, a freshman studying drumming at a music conservatory in New York City considered to be perhaps the best such school in the country. Andrew relates to his drum kit better than he relates to his fellow human beings. This talented kid is 19, and he should be enjoying all the cultural and life-experience wealth New York City has to offer — but his only friend seems to be his father (Paul Reiser), with whom he still goes to the movies. When Andrew finally gets up the courage to court a charming, quirky, cute girl (Melissa Benoist) who clearly likes him, he’s so blunt in assessing their relationship she finally says, “What is WRONG with you?”

Andrew idolizes the legendary drummer Buddy Rich, and he immerses himself in jazz recordings from more than a half- century ago. (The title of the film comes from a Hank Levy composition of the same name.) He plays until his hands are literally bleeding, and then he jams his hands in a bowl of ice, tapes them up and keeps on drumming.

There must be dozens if not hundreds of instructors at the school, but the only one that seems to matter is Terence Fletcher (J.K. Simmons), who wears all black and moves about the darkened hallways with vampire-like stealth, sometimes appearing as a shadowy figure outside a classroom — and then poof! He’s gone.

Fletcher has the rigid posture, imposing physicality and strict cadence of a drill instructor. If one of his students is a hair behind or ahead of him, he will start off by quietly saying, “Not my tempo,” and three mistakes later he will be in your face, spitting and screaming, the veins popping on his head as he insults your ethnicity, mocks your sexual orientation and screams, “NOT MY TEMPO!”

Even during the dialogue-driven sequences, “Whiplash” is edited like a fast-paced musical, with Chazelle cutting in rapid-fire fashion, swinging his camera back and forth like a trombonist in a band, zooming in for close-ups of Andrew’s kit showing the blood, sweat and tears he’s giving up in his pursuit of greatness — and his obsession with gaining Fletcher’s approval. For a film about a college prodigy trying to make a name with the school’s jazz band, there’s an awful lot of blood and pain, physical and emotional.

In the quieter scenes with Reiser and Benoist, Teller is spot-on, whether he’s enjoying a rare moment of inner quiet or he’s revealing the ugly side of his drive to be great. He also holds his own in his scenes with Simmons, the affable character actor (“Juno,” “Spider-Man,” those ubiquitous insurance commercials), who has been given maybe the best role of his career and delivers a performance worthy of serious best supporting actor talk.

Every commentator, columnist and old-school coach who loathes the notion of “participation trophies” and letting everybody make the team will love this movie. Even when Fletcher is at his most monstrous, he never wavers in his conviction that one must be pushed, shoved and even slapped before one can discover inner greatness. (A story about drummer Jo Jones once throwing a cymbal at the head of young Charlie Parker — an incident that inspired Parker to work that much harder and achieve immortality — is told multiple times, and embellished a bit, to illustrate Fletcher’s point.)

I wasn’t entirely sold on the conclusion, which seemed so over the top I was waiting to make sure it wasn’t a fantasy sequence. (It wasn’t.) But the music is brilliant, Chazelle’s writing and directing are something to behold, Teller is really good — and Simmons delivers one of the most memorable performances of the year.

[s3r star=3.5/4]

Sony Pictures Classics presents a film written and directed by Damien Chazelle. Running time: 106 minutes. Rated R (for strong language including some sexual references). Opens Friday at local theaters.