2 * MQ-coder encoder and decoder common functions
3 * Copyright (c) 2007 Kamil Nowosad
5 * This file is part of FFmpeg.
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 * MQ-coder ecoder and decoder common functions
25 * @author Kamil Nowosad
37 const static MqcCxState cx_states[47] = {
87 uint16_t ff_mqc_qe [2*47];
88 uint8_t ff_mqc_nlps[2*47];
89 uint8_t ff_mqc_nmps[2*47];
91 void ff_mqc_init_contexts(MqcState *mqc)
94 memset(mqc->cx_states, 0, sizeof(mqc->cx_states));
95 mqc->cx_states[MQC_CX_UNI] = 2 * 46;
96 mqc->cx_states[MQC_CX_RL] = 2 * 3;
97 mqc->cx_states[0] = 2 * 4;
99 for (i = 0; i < 47; i++){
101 ff_mqc_qe[2*i+1] = cx_states[i].qe;
103 ff_mqc_nlps[2*i ] = 2*cx_states[i].nlps + cx_states[i].sw;
104 ff_mqc_nlps[2*i+1] = 2*cx_states[i].nlps + 1 - cx_states[i].sw;
105 ff_mqc_nmps[2*i ] = 2*cx_states[i].nmps;
106 ff_mqc_nmps[2*i+1] = 2*cx_states[i].nmps + 1;