As far as I remember (I used to be Brazilian) the tax is applied to the difference, so 20% is discounted from the maximum for the 20% bracket, and 27.5% (and, boy, I wish I only paid 27.5% tax here) is applied to the difference.
Or am I misremembering? Maybe it's taken from the payslip, but returned with the yearly adjustment (which could make sense)