It is tedious.
I'm sure your example is hypothetical, but there were no 'S' minted 1964 coins. Anywhoo...
To answer your question - in a word, no. Dies were hung on the press, used, and destroyed. They were not shipped from place to place and used on different presses, and no coins with one mintmark were struck at a mint that uses a different (or no) mintmark. So, to that effect, it is impossible for a 1964P doubled die to have been used in Denver as a 1964D doubled die.
There are presently (embarassingly) only 7 different doubled die reverse dies listed on my site for 1964 Philly minted cents (both business strike and proof). There are actually over 30 different dies known - how do I know? I own over 20 different ones, most I have never listed or photographed...just no time. Additionally, CONECA lists 32 different dies, and Wexler had at one time listed at LEAST 63 different doubled dies for 1964P reverses. How do I know that? Page 193 of the Authoritative Reference on Lincoln Cents (1996) shows a cross reference to CONECA 63-R-II. That first number is the die number, which meant there were 62 other documented dies. The original CONECA system was scrapped some time between 2000 and 2004 for a total rebuild, and to date they have (re)listed 32 different dies.
My box-o-coins to add contains 46 examples of 1964 Philly doubled die reverse cents that I have not yet had the time to attribute - many of them are proof issues...I assume by statistics (and educated guessing) that there are probably about 25 different dies represented there, and none of them are likely any of the 7 I already have listed.
There's a good 14 hours (2-3 full work days) of time to invest in getting the record straight on just what I own...never mind the tens of thousands of 1964P DDRs out there that nobody has a useful die number on.
So you see...it's a LOT, LOT more involved than this being die #1 or die #2 based on whether it's a business strike or a proof. There's actually a science built into this, and detailed investigation is necessary to determine whether your coin was struck by a previously known die. This is why I said (and commonly say) that the exact die that minted your coin cannot be determined with the images provided. It is very often simply impossible to see the details necessary.