Appellant was convicted of possession of cocaine and a prior strike. At sentencing the trial court imposed a $50 lab analysis fee, but did not impose the state and county penalties based on the fee as required by Penal Code section 1464 and Government Code section 76000, subdivision (a). The prosecution did not object at sentencing. The Court of Appeal imposed the penalties because they were mandatory, not discretionary, sentencing choices, and therefore could be raised for the first time on appeal. Appellant petitioned for review, contending that the Court of Appeal erred because the trial court had discretion to waive the penalties under subdivision (d) of Penal Code section 1464. The Supreme Court here affirmed. The language of section 1464, subdivision (b) only gives the court discretion to waive the penalties if the defendant is actually in prison for failure to pay a fine. Since appellant was not, the trial court had no discretion to waive the penalties, and thus the Court of Appeal properly corrected the omission on appeal.