#This work is licensed under the
#Creative Commons Attribution-Share Alike 3.0 United States License.
#To view a copy of this license, visit
#http://creativecommons.org/licenses/by-sa/3.0/us/ or send a letter to
#Creative Commons,
#171 Second Street, Suite 300,
#San Francisco, California, 94105, USA.

INPUT "\"mdat\" atom data";
OUTPUT "QLP shift needed, QLP coefficient count, QLP coefficients as list of signed integers";
VAR prediction_type "prediction type";
VAR rice_modifier "Rice modifier";
VAR QLP_coeff_count "QLP coefficient count";
VAR QLP_shift "QLP shift needed";
VAR QLP_coeff "QLP coefficient";
prediction_type <- read 4 unsigned;
QLP_shift <- read 4 unsigned;
rice_modifier <- read 3 unsigned;
QLP_coeff_count <- read 5 unsigned;
assert prediction_type == 0;
assert (QLP_coeff_count == 4) or (QLP_coeff_count == 8);
for i <- 0 to QLP_coeff_count {
    QLP_coeff[i] <- read 16 signed;
}
return QLP_shift,QLP_coeff_count,QLP_coeff;
