Everything has to go perfect (on Martin's end) for the book to come out prior to the show, and there probably has to be a time period greater than 12 months between season 7 and season 8, for even if the book is out, the scripts have to be finished followed by 6 to 9 months of shooting, etc.
And yes there is plenty of material for a 20 episodes detailing a AFFC and ADWD. Remember AFFC is a little bit longer than AGOT, and ADWD is as longer than ASOS.
You still haven't read the books have you?