It's original to the show. So is this:
Every chapter in the books is written from a character perspective, and Jaime wasn't a chapter character until book 3. Tywin was never a chapter character. Robert Baratheon was never a chapter character. Barristan only gets chapter characters in book 5. We didn't get to see this stuff because we didn't get these characters' perspectives.
And that made me slightly concerned, since one of the points of the books is to make a distinction between how a character is perceived and what's going on in their heads. As a reader, I thought Jaime was just a preening arrogant, child-murdering dickhead until book 3, when suddenly we got to understand things from inside his skull, and how he changed from possibly the greatest Westerosi swordsman to having lost his sword hand. The change isn't as dramatic in the show, because both of these scenes give the impression that Jaime has another side to him, and that the story told about him might not be the whole story.
Even so, when I first saw these new scenes, and the quality of the dialogue and performances, I felt super confident that one of my favourite book series was in very safe hands.
It's widely held that the books drop in quality after book 3, and I've been fairly sure for a very long time that Martin has no fucking clue how to wrap up the story. He claims to have an ending, but he's got no fucking idea how to get there. So the show was always going to be in trouble as the seasons went on. I was happy enough to see what I'd read adapted to screen, and that was awesome for the first four seasons. After that, it was an inevitable clusterfuck.
But damn, I could never have predicted just how bad things would get. This season is something else. It's now some of the trashiest television going, in a supposed golden age of television. And that's fine, I guess. I'm not too high-brow to not enjoy a bit of trash television. But considering where we started, it's tragically and hilariously impressive how much potential has been squandered.