159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong/* ------------------------------------------------------------------
259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * Copyright (C) 1998-2009 PacketVideo
359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong *
459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * Licensed under the Apache License, Version 2.0 (the "License");
559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * you may not use this file except in compliance with the License.
659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * You may obtain a copy of the License at
759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong *
859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong *      http://www.apache.org/licenses/LICENSE-2.0
959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong *
1059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * Unless required by applicable law or agreed to in writing, software
1159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * distributed under the License is distributed on an "AS IS" BASIS,
1259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
1359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * express or implied.
1459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * See the License for the specific language governing permissions
1559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * and limitations under the License.
1659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * -------------------------------------------------------------------
1759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong */
1859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong/******************************************************************************
1959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong *
2059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * This software module was originally developed by
2159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong *
2259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * Robert Danielsen (Telenor / ACTS-MoMuSys).
2359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong *
2459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * and edited by
2559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong *
2659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * Minhua Zhou (HHI / ACTS-MoMuSys).
2759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * Luis Ducla-Soares (IST / ACTS-MoMuSys).
2859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong *
2959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * in the course of development of the MPEG-4 Video (ISO/IEC 14496-2) standard.
3059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * This software module is an implementation of a part of one or more MPEG-4
3159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * Video (ISO/IEC 14496-2) tools as specified by the MPEG-4 Video (ISO/IEC
3259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * 14496-2) standard.
3359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong *
3459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * ISO/IEC gives users of the MPEG-4 Video (ISO/IEC 14496-2) standard free
3559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * license to this software module or modifications thereof for use in hardware
3659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * or software products claiming conformance to the MPEG-4 Video (ISO/IEC
3759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * 14496-2) standard.
3859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong *
3959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * Those intending to use this software module in hardware or software products
4059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * are advised that its use may infringe existing patents. The original
4159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * developer of this software module and his/her company, the subsequent
4259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * editors and their companies, and ISO/IEC have no liability for use of this
4359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * software module or modifications thereof in an implementation. Copyright is
4459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * not released for non MPEG-4 Video (ISO/IEC 14496-2) standard conforming
4559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * products.
4659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong *
4759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * ACTS-MoMuSys partners retain full right to use the code for his/her own
4859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * purpose, assign or donate the code to a third party and to inhibit third
4959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * parties from using the code for non MPEG-4 Video (ISO/IEC 14496-2) standard
5059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * conforming products. This copyright notice must be included in all copies or
5159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * derivative works.
5259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong *
5359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * Copyright (c) 1997
5459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong *
5559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong *****************************************************************************/
5659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
5759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
5859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong/***********************************************************HeaderBegin*******
5959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong *
6059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * File:    vlc.h
6159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong *
6259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * Author:  Robert Danielsen
6359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * Created: 07.06.96
6459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong *
6559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * Description: vlc tables for encoder
6659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong *
6759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * Notes:   Idea taken from MPEG-2 software simulation group
6859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong *
6959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong * Modified:
7059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong *  28.10.96 Robert Danielsen: Added tables for Intra luminance
7159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong *          coefficients
7259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong *      01.05.97 Luis Ducla-Soares: added VM7.0 Reversible VLC tables (RVLC).
7359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong *      13.05.97 Minhua Zhou: added cbpy_tab3,cbpy_tab2
7459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong *
7559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong ***********************************************************HeaderEnd*********/
7659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
7759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong/************************    INCLUDE FILES    ********************************/
7859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
7959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong#ifndef _VLC_ENC_TAB_H_
8059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong#define _VLC_ENC_TAB_H_
8159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
8259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
8359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong#include "mp4def.h"
8459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong/* type definitions for variable length code table entries */
8559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
8659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
8759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
8859f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const Int intra_max_level[2][64] =
8959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
9059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {27, 10,  5,  4,  3,  3,  3,  3,
9159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        2,  2,  1,  1,  1,  1,  1,  0,
9259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        0,  0,  0,  0,  0,  0,  0,  0,
9359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        0,  0,  0,  0,  0,  0,  0,  0,
9459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        0,  0,  0,  0,  0,  0,  0,  0,
9559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        0,  0,  0,  0,  0,  0,  0,  0,
9659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        0,  0,  0,  0,  0,  0,  0,  0,
9759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        0,  0,  0,  0,  0,  0,  0,  0,
9859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
9959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
10059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {8,  3,  2,  2,  2,  2,  2,  1,
10159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong     1,  1,  1,  1,  1,  1,  1,  1,
10259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong     1,  1,  1,  1,  1,  0,  0,  0,
10359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong     0,  0,  0,  0,  0,  0,  0,  0,
10459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong     0,  0,  0,  0,  0,  0,  0,  0,
10559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong     0,  0,  0,  0,  0,  0,  0,  0,
10659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong     0,  0,  0,  0,  0,  0,  0,  0,
10759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong     0,  0,  0,  0,  0,  0,  0,  0
10859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    }
10959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
11059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
11159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
11259f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const Int inter_max_level[2][64] =
11359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
11459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {12,  6,  4,  3,  3,  3,  3,  2,
11559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        2,  2,  2,  1,  1,  1,  1,  1,
11659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        1,  1,  1,  1,  1,  1,  1,  1,
11759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        1,  1,  1,  0,  0,  0,  0,  0,
11859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        0,  0,  0,  0,  0,  0,  0,  0,
11959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        0,  0,  0,  0,  0,  0,  0,  0,
12059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        0,  0,  0,  0,  0,  0,  0,  0,
12159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        0,  0,  0,  0,  0,  0,  0,  0},
12259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
12359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {3,  2,  1,  1,  1,  1,  1,  1,
12459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong     1,  1,  1,  1,  1,  1,  1,  1,
12559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong     1,  1,  1,  1,  1,  1,  1,  1,
12659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong     1,  1,  1,  1,  1,  1,  1,  1,
12759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong     1,  1,  1,  1,  1,  1,  1,  1,
12859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong     1,  0,  0,  0,  0,  0,  0,  0,
12959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong     0,  0,  0,  0,  0,  0,  0,  0,
13059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong     0,  0,  0,  0,  0,  0,  0,  0}
13159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
13259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
13359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
13459f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const Int intra_max_run0[28] = { 999, 14,  9,  7,  3,  2,  1,
13559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong                                        1,  1,  1,  1,  0,  0,  0,
13659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong                                        0,  0,  0,  0,  0,  0,  0,
13759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong                                        0,  0,  0,  0,  0,  0,  0
13859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong                                      };
13959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
14059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
14159f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const Int intra_max_run1[9] = { 999, 20,  6,
14259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong                                       1,  0,  0,
14359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong                                       0,  0,  0
14459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong                                     };
14559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
14659f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const Int inter_max_run0[13] = { 999,
14759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong                                        26, 10,  6,  2,  1,  1,
14859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong                                        0,  0,  0,  0,  0,  0
14959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong                                      };
15059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
15159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
15259f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const Int inter_max_run1[4] = { 999, 40,  1,  0 };
15359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
15459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
15559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
15659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong/* DC prediction sizes */
15759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
15859f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable DCtab_lum[13] =
15959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
16059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {3, 3}, {3, 2}, {2, 2}, {2, 3}, {1, 3}, {1, 4}, {1, 5}, {1, 6}, {1, 7},
16159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {1, 8}, {1, 9}, {1, 10}, {1, 11}
16259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
16359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
16459f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable DCtab_chrom[13] =
16559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
16659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {3, 2}, {2, 2}, {1, 2}, {1, 3}, {1, 4}, {1, 5}, {1, 6}, {1, 7}, {1, 8},
16759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {1, 9}, {1, 10}, {1, 11}, {1, 12}
16859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
16959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
17059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong/* Motion vectors */
17159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
17259f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable mvtab[33] =
17359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
17459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {1, 1}, {1, 2}, {1, 3}, {1, 4}, {3, 6}, {5, 7}, {4, 7}, {3, 7},
17559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {11, 9}, {10, 9}, {9, 9}, {17, 10}, {16, 10}, {15, 10}, {14, 10}, {13, 10},
17659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {12, 10}, {11, 10}, {10, 10}, {9, 10}, {8, 10}, {7, 10}, {6, 10}, {5, 10},
17759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {4, 10}, {7, 11}, {6, 11}, {5, 11}, {4, 11}, {3, 11}, {2, 11}, {3, 12},
17859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {2, 12}
17959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
18059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
18159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
18259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong/* MCBPC Indexing by cbpc in first two bits, mode in last two.
18359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong CBPC as in table 4/H.263, MB type (mode): 3 = 01, 4 = 10.
18459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong Example: cbpc = 01 and mode = 4 gives index = 0110 = 6. */
18559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
18659f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable mcbpc_intra_tab[15] =
18759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
18859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {0x01, 9}, {0x01, 1}, {0x01, 4}, {0x00, 0},
18959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {0x00, 0}, {0x01, 3}, {0x01, 6}, {0x00, 0},
19059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {0x00, 0}, {0x02, 3}, {0x02, 6}, {0x00, 0},
19159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {0x00, 0}, {0x03, 3}, {0x03, 6}
19259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
19359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
19459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
19559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong/* MCBPC inter.
19659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong   Addressing: 5 bit ccmmm (cc = CBPC, mmm = mode (1-4 binary)) */
19759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
19859f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable mcbpc_inter_tab[29] =
19959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
20059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {1, 1}, {3, 3}, {2, 3}, {3, 5}, {4, 6}, {1, 9}, {0, 0}, {0, 0},
20159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {3, 4}, {7, 7}, {5, 7}, {4, 8}, {4, 9}, {0, 0}, {0, 0}, {0, 0},
20259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {2, 4}, {6, 7}, {4, 7}, {3, 8}, {3, 9}, {0, 0}, {0, 0}, {0, 0},
20359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {5, 6}, {5, 9}, {5, 8}, {3, 7}, {2, 9}
20459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
20559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
20659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
20759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
20859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong/* CBPY. Straightforward indexing */
20959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
21059f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable cbpy_tab[16] =
21159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
21259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {3, 4}, {5, 5}, {4, 5}, {9, 4}, {3, 5}, {7, 4}, {2, 6}, {11, 4},
21359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {2, 5}, {3, 6}, {5, 4}, {10, 4}, {4, 4}, {8, 4}, {6, 4}, {3, 2}
21459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
21559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
21659f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable cbpy_tab3[8] =
21759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
21859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {3, 3}, {1, 6}, {1, 5}, {2, 3}, {2, 5}, {3, 5}, {1, 3}, {1, 1}
21959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
22059f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable cbpy_tab2[4] =
22159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
22259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {1, 4}, {1, 3}, {1, 2}, {1, 1}
22359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
22459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
22559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong/* DCT coefficients. Four tables, two for last = 0, two for last = 1.
22659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong   the sign bit must be added afterwards. */
22759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
22859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong/* first part of coeffs for last = 0. Indexed by [run][level-1] */
22959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
23059f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable coeff_tab0[2][12] =
23159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
23259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 0 */
23359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
23459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x02, 2}, {0x0f, 4}, {0x15, 6}, {0x17, 7},
23559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x1f, 8}, {0x25, 9}, {0x24, 9}, {0x21, 10},
23659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x20, 10}, {0x07, 11}, {0x06, 11}, {0x20, 11}
23759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
23859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 1 */
23959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
24059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x06, 3}, {0x14, 6}, {0x1e, 8}, {0x0f, 10},
24159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x21, 11}, {0x50, 12}, {0x00, 0}, {0x00, 0},
24259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}
24359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    }
24459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
24559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
24659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong/* rest of coeffs for last = 0. indexing by [run-2][level-1] */
24759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
24859f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable coeff_tab1[25][4] =
24959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
25059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 2 */
25159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
25259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x0e, 4}, {0x1d, 8}, {0x0e, 10}, {0x51, 12}
25359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
25459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 3 */
25559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
25659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x0d, 5}, {0x23, 9}, {0x0d, 10}, {0x00, 0}
25759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
25859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 4-26 */
25959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
26059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x0c, 5}, {0x22, 9}, {0x52, 12}, {0x00, 0}
26159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
26259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
26359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x0b, 5}, {0x0c, 10}, {0x53, 12}, {0x00, 0}
26459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
26559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
26659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x13, 6}, {0x0b, 10}, {0x54, 12}, {0x00, 0}
26759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
26859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
26959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x12, 6}, {0x0a, 10}, {0x00, 0}, {0x00, 0}
27059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
27159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
27259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x11, 6}, {0x09, 10}, {0x00, 0}, {0x00, 0}
27359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
27459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
27559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x10, 6}, {0x08, 10}, {0x00, 0}, {0x00, 0}
27659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
27759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
27859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x16, 7}, {0x55, 12}, {0x00, 0}, {0x00, 0}
27959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
28059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
28159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x15, 7}, {0x00, 0}, {0x00, 0}, {0x00, 0}
28259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
28359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
28459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x14, 7}, {0x00, 0}, {0x00, 0}, {0x00, 0}
28559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
28659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
28759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x1c, 8}, {0x00, 0}, {0x00, 0}, {0x00, 0}
28859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
28959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
29059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x1b, 8}, {0x00, 0}, {0x00, 0}, {0x00, 0}
29159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
29259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
29359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x21, 9}, {0x00, 0}, {0x00, 0}, {0x00, 0}
29459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
29559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
29659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x20, 9}, {0x00, 0}, {0x00, 0}, {0x00, 0}
29759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
29859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
29959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x1f, 9}, {0x00, 0}, {0x00, 0}, {0x00, 0}
30059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
30159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
30259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x1e, 9}, {0x00, 0}, {0x00, 0}, {0x00, 0}
30359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
30459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
30559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x1d, 9}, {0x00, 0}, {0x00, 0}, {0x00, 0}
30659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
30759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
30859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x1c, 9}, {0x00, 0}, {0x00, 0}, {0x00, 0}
30959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
31059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
31159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x1b, 9}, {0x00, 0}, {0x00, 0}, {0x00, 0}
31259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
31359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
31459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x1a, 9}, {0x00, 0}, {0x00, 0}, {0x00, 0}
31559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
31659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
31759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x22, 11}, {0x00, 0}, {0x00, 0}, {0x00, 0}
31859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
31959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
32059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x23, 11}, {0x00, 0}, {0x00, 0}, {0x00, 0}
32159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
32259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
32359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x56, 12}, {0x00, 0}, {0x00, 0}, {0x00, 0}
32459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
32559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
32659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x57, 12}, {0x00, 0}, {0x00, 0}, {0x00, 0}
32759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    }
32859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
32959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
33059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong/* first coeffs of last = 1. indexing by [run][level-1] */
33159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
33259f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable coeff_tab2[2][3] =
33359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
33459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 0 */
33559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
33659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x07, 4}, {0x19, 9}, {0x05, 11}
33759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
33859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 1 */
33959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
34059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x0f, 6}, {0x04, 11}, {0x00, 0}
34159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    }
34259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
34359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
34459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong/* rest of coeffs for last = 1. indexing by [run-2] */
34559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
34659f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable coeff_tab3[40] =
34759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
34859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {0x0e, 6}, {0x0d, 6}, {0x0c, 6},
34959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {0x13, 7}, {0x12, 7}, {0x11, 7}, {0x10, 7},
35059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {0x1a, 8}, {0x19, 8}, {0x18, 8}, {0x17, 8},
35159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {0x16, 8}, {0x15, 8}, {0x14, 8}, {0x13, 8},
35259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {0x18, 9}, {0x17, 9}, {0x16, 9}, {0x15, 9},
35359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {0x14, 9}, {0x13, 9}, {0x12, 9}, {0x11, 9},
35459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {0x07, 10}, {0x06, 10}, {0x05, 10}, {0x04, 10},
35559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {0x24, 11}, {0x25, 11}, {0x26, 11}, {0x27, 11},
35659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {0x58, 12}, {0x59, 12}, {0x5a, 12}, {0x5b, 12},
35759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {0x5c, 12}, {0x5d, 12}, {0x5e, 12}, {0x5f, 12},
35859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {0x00, 0}
35959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
36059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
36159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong/* New tables for Intra luminance coefficients. Same codewords,
36259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong   different meaning */
36359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
36459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong/* Coeffs for last = 0, run = 0. Indexed by [level-1] */
36559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
36659f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable coeff_tab4[27] =
36759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
36859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 0 */
36959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {0x02, 2}, {0x06, 3}, {0x0f, 4}, {0x0d, 5},
37059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {0x0c, 5}, {0x15, 6}, {0x13, 6}, {0x12, 6},
37159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {0x17, 7}, {0x1f, 8}, {0x1e, 8}, {0x1d, 8},
37259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {0x25, 9}, {0x24, 9}, {0x23, 9}, {0x21, 9},
37359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {0x21, 10}, {0x20, 10}, {0x0f, 10}, {0x0e, 10},
37459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {0x07, 11}, {0x06, 11}, {0x20, 11}, {0x21, 11},
37559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {0x50, 12}, {0x51, 12}, {0x52, 12}
37659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
37759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
37859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong/* Coeffs for last = 0, run = 1. Indexed by [level-1] */
37959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
38059f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable coeff_tab5[10] =
38159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
38259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {0x0e, 4}, {0x14, 6}, {0x16, 7}, {0x1c, 8},
38359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {0x20, 9}, {0x1f, 9}, {0x0d, 10}, {0x22, 11},
38459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {0x53, 12}, {0x55, 12}
38559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
38659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
38759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong/* Coeffs for last = 0, run = 2 -> 9. Indexed by [run-2][level-1] */
38859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
38959f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable coeff_tab6[8][5] =
39059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
39159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 2 */
39259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
39359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x0b, 5}, {0x15, 7}, {0x1e, 9}, {0x0c, 10},
39459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x56, 12}
39559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
39659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 3 */
39759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
39859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x11, 6}, {0x1b, 8}, {0x1d, 9}, {0x0b, 10},
39959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x00, 0}
40059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
40159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 4 */
40259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
40359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x10, 6}, {0x22, 9}, {0x0a, 10}, {0x00, 0},
40459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x00, 0}
40559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
40659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 5 */
40759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
40859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x0d, 6}, {0x1c, 9}, {0x08, 10}, {0x00, 0},
40959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x00, 0}
41059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
41159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 6 */
41259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
41359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x12, 7}, {0x1b, 9}, {0x54, 12}, {0x00, 0},
41459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x00, 0}
41559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
41659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 7 */
41759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
41859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x14, 7}, {0x1a, 9}, {0x57, 12}, {0x00, 0},
41959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x00, 0}
42059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
42159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 8 */
42259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
42359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x19, 8}, {0x09, 10}, {0x00, 0}, {0x00, 0},
42459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x00, 0}
42559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
42659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 9 */
42759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
42859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x18, 8}, {0x23, 11}, {0x00, 0}, {0x00, 0},
42959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x00, 0}
43059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    }
43159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
43259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
43359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong/* Coeffs for last = 0, run = 10 -> 14. Indexed by [run-10] */
43459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
43559f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable coeff_tab7[5] =
43659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
43759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {0x17, 8}, {0x19, 9}, {0x18, 9}, {0x07, 10},
43859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {0x58, 12}
43959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
44059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
44159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong/* Coeffs for last = 1, run = 0. Indexed by [level-1] */
44259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
44359f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable coeff_tab8[8] =
44459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
44559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {0x07, 4}, {0x0c, 6}, {0x16, 8}, {0x17, 9},
44659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {0x06, 10}, {0x05, 11}, {0x04, 11}, {0x59, 12}
44759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
44859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
44959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong/* Coeffs for last = 1, run = 1 -> 6. Indexed by [run-1][level-1] */
45059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
45159f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable coeff_tab9[6][3] =
45259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
45359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 1 */
45459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
45559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x0f, 6}, {0x16, 9}, {0x05, 10}
45659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
45759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 2 */
45859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
45959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x0e, 6}, {0x04, 10}, {0x00, 0}
46059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
46159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 3 */
46259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
46359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x11, 7}, {0x24, 11}, {0x00, 0}
46459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
46559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 4 */
46659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
46759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x10, 7}, {0x25, 11}, {0x00, 0}
46859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
46959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 5 */
47059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
47159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x13, 7}, {0x5a, 12}, {0x00, 0}
47259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
47359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 6 */
47459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
47559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {0x15, 8}, {0x5b, 12}, {0x00, 0}
47659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    }
47759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
47859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
47959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong/* Coeffs for last = 1, run = 7 -> 20. Indexed by [run-7] */
48059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
48159f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable coeff_tab10[14] =
48259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
48359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {0x14, 8}, {0x13, 8}, {0x1a, 8}, {0x15, 9},
48459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {0x14, 9}, {0x13, 9}, {0x12, 9}, {0x11, 9},
48559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {0x26, 11}, {0x27, 11}, {0x5c, 12}, {0x5d, 12},
48659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {0x5e, 12}, {0x5f, 12}
48759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
48859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
48959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
49059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong#ifndef NO_RVLC
49159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong/* RVLC tables */
49259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong/* DCT coefficients. Four tables, two for last = 0, two for last = 1.
49359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong   the sign bit must be added afterwards. */
49459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
49559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong/* DCT  coeffs (intra) for last = 0.  */
49659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
49759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong/* Indexed by [level-1] */
49859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
49959f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable coeff_RVLCtab1[27] =
50059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
50159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 0 */
50259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {     0x6,  3},
50359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {     0x7,  3},
50459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {     0xa,  4},
50559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {     0x9,  5},
50659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {    0x14,  6},
50759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {    0x15,  6},
50859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {    0x34,  7},
50959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {    0x74,  8},
51059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {    0x75,  8},
51159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {    0xdd,  9},
51259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {    0xec,  9},
51359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x1ec, 10},
51459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x1ed, 10},
51559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x1f4, 10},
51659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x3ec, 11},
51759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x3ed, 11},
51859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x3f4, 11},
51959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x77d, 12},
52059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x7bc, 12},
52159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0xfbd, 13},
52259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0xfdc, 13},
52359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x7bd, 12},
52459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0xfdd, 13},
52559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x1fbd, 14},
52659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x1fdc, 14},
52759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x1fdd, 14},
52859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x1ffc, 15}
52959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
53059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
53159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
53259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong/* Indexed by [level-1] */
53359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
53459f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable coeff_RVLCtab2[13] =
53559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
53659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 1 */
53759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {     0x1,  4},
53859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {     0x8,  5},
53959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {    0x2d,  7},
54059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {    0x6c,  8},
54159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {    0x6d,  8},
54259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {    0xdc,  9},
54359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x1dd, 10},
54459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x3dc, 11},
54559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x3dd, 11},
54659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x77c, 12},
54759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0xfbc, 13},
54859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x1f7d, 14},
54959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x1fbc, 14}
55059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
55159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
55259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
55359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong/* Indexed by [level-1] */
55459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
55559f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable coeff_RVLCtab3[11] =
55659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
55759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 2 */
55859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
55959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {     0x4,  5},
56059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {    0x2c,  7},
56159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {    0xbc,  9},
56259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x1dc, 10},
56359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x3bc, 11},
56459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x3bd, 11},
56559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0xefd, 13},
56659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0xf7c, 13},
56759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0xf7d, 13},
56859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x1efd, 14},
56959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x1f7c, 14}
57059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
57159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
57259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
57359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong/* Indexed by [level-1] */
57459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
57559f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable coeff_RVLCtab4[9] =
57659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
57759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 3 */
57859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {     0x5,  5},
57959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {    0x5c,  8},
58059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {    0xbd,  9},
58159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x37d, 11},
58259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x6fc, 12},
58359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0xefc, 13},
58459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x1dfd, 14},
58559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x1efc, 14},
58659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x1ffd, 15}
58759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
58859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
58959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
59059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong/* Indexed by [run-4][level-1] */
59159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
59259f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable coeff_RVLCtab5[2][6] =
59359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
59459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 4 */
59559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
59659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {     0xc,  6},
59759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x5d,  8},
59859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0x1bd, 10},
59959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0x3fd, 12},
60059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0x6fd, 12},
60159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {  0x1bfd, 14}
60259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
60359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 5 */
60459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
60559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {     0xd,  6},
60659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x7d,  9},
60759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0x2fc, 11},
60859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0x5fc, 12},
60959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {  0x1bfc, 14},
61059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {  0x1dfc, 14}
61159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    }
61259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
61359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
61459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
61559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong/* Indexed by [run-6][level-1]       */
61659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
61759f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable coeff_RVLCtab6[2][5] =
61859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
61959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
62059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 6 */
62159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
62259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x1c,  7},
62359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0x17c, 10},
62459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0x2fd, 11},
62559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0x5fd, 12},
62659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {  0x2ffc, 15}
62759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
62859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 7 */
62959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
63059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x1d,  7},
63159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0x17d, 10},
63259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0x37c, 11},
63359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0xdfd, 13},
63459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {  0x2ffd, 15}
63559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    }
63659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
63759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
63859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong/* Indexed by [run-8][level-1] */
63959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
64059f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable coeff_RVLCtab7[2][4] =
64159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
64259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 8 */
64359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
64459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x3c,  8},
64559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0x1bc, 10},
64659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0xbfd, 13},
64759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {  0x17fd, 14}
64859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
64959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 9 */
65059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
65159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x3d,  8},
65259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0x1fd, 11},
65359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0xdfc, 13},
65459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {  0x37fc, 15},
65559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    }
65659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
65759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
65859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
65959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
66059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong/* Indexed by [run-10][level-1] */
66159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
66259f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable coeff_RVLCtab8[3][2] =
66359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
66459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 10 */
66559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
66659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x7c,  9},
66759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0x3fc, 12}
66859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
66959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 11 */
67059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
67159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0xfc, 10},
67259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0xbfc, 13}
67359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
67459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 12 */
67559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
67659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0xfd, 10},
67759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {  0x37fd, 15}
67859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    }
67959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
68059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
68159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
68259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong/* Indexed by [level-1] */
68359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
68459f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable coeff_RVLCtab9[7] =
68559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
68659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 13 -> 19 */
68759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x1fc, 11},
68859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x7fc, 13},
68959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x7fd, 13},
69059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0xffc, 14},
69159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0xffd, 14},
69259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x17fc, 14},
69359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x3bfc, 15}
69459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
69559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
69659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
69759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
69859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong/* first coeffs of last = 1. indexing by [run][level-1] */
69959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
70059f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable coeff_RVLCtab10[2][5] =
70159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
70259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 0 */
70359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
70459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {     0xb,  4},
70559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x78,  8},
70659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0x3f5, 11},
70759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0xfec, 13},
70859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {  0x1fec, 14}
70959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
71059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 1 */
71159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
71259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x12,  5},
71359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0xed,  9},
71459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0x7dc, 12},
71559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {  0x1fed, 14},
71659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {  0x3bfd, 15}
71759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    }
71859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
71959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
72059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
72159f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable coeff_RVLCtab11[3] =
72259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
72359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 2 */
72459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {    0x13,  5},
72559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x3f8, 11},
72659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x3dfc, 15}
72759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
72859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
72959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
73059f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable coeff_RVLCtab12[11][2] =
73159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
73259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 3 */
73359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
73459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x18,  6},
73559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0x7dd, 12}
73659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
73759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 4 */
73859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
73959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x19,  6},
74059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0x7ec, 12}
74159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
74259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 5 */
74359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
74459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x22,  6},
74559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0xfed, 13}
74659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
74759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 6 */
74859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
74959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x23,  6},
75059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0xff4, 13}
75159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
75259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 7 */
75359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
75459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x35,  7},
75559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0xff5, 13}
75659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
75759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 8 */
75859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
75959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x38,  7},
76059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0xff8, 13}
76159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
76259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 9 */
76359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
76459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x39,  7},
76559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0xff9, 13}
76659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
76759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 10 */
76859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
76959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x42,  7},
77059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {  0x1ff4, 14}
77159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
77259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 11 */
77359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
77459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x43,  7},
77559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {  0x1ff5, 14}
77659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
77759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 12 */
77859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
77959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x79,  8},
78059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {  0x1ff8, 14}
78159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
78259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 13 */
78359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
78459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x82,  8},
78559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {  0x3dfd, 15}
78659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    }
78759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
78859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
78959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
79059f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable coeff_RVLCtab13[32] =
79159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
79259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 14 -> 44 */
79359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {    0x83,  8},
79459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {    0xf4,  9},
79559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {    0xf5,  9},
79659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {    0xf8,  9},
79759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {    0xf9,  9},
79859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x102,  9},
79959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x103,  9},
80059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x1f5, 10},
80159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x1f8, 10},
80259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x1f9, 10},
80359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x202, 10},
80459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x203, 10},
80559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x3f9, 11},
80659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x402, 11},
80759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x403, 11},
80859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x7ed, 12},
80959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x7f4, 12},
81059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x7f5, 12},
81159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x7f8, 12},
81259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x7f9, 12},
81359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x802, 12},
81459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x803, 12},
81559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x1002, 13},
81659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x1003, 13},
81759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x1ff9, 14},
81859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x2002, 14},
81959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x2003, 14},
82059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x3efc, 15},
82159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x3efd, 15},
82259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x3f7c, 15},
82359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x3f7d, 15}
82459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
82559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
82659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
82759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
82859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong/* Coeffs for last = 0, run = 0. Indexed by [level-1] */
82959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
83059f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable coeff_RVLCtab14[19] =
83159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
83259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 0 */
83359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {     0x6,  3},
83459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {     0x1,  4},
83559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {     0x4,  5},
83659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {    0x1c,  7},
83759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {    0x3c,  8},
83859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {    0x3d,  8},
83959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {    0x7c,  9},
84059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {    0xfc, 10},
84159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {    0xfd, 10},
84259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x1fc, 11},
84359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x1fd, 11},
84459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x3fc, 12},
84559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x7fc, 13},
84659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x7fd, 13},
84759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0xbfc, 13},
84859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0xbfd, 13},
84959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0xffc, 14},
85059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0xffd, 14},
85159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x1ffc, 15}
85259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
85359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
85459f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable coeff_RVLCtab15[10] =
85559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
85659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 1 */
85759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {     0x7,  3},
85859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {     0xc,  6},
85959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {    0x5c,  8},
86059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {    0x7d,  9},
86159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x17c, 10},
86259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x2fc, 11},
86359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x3fd, 12},
86459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0xdfc, 13},
86559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x17fc, 14},
86659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x17fd, 14}
86759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
86859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
86959f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable coeff_RVLCtab16[2][7] =
87059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
87159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 2 */
87259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
87359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {     0xa,  4},
87459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x1d,  7},
87559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0xbc,  9},
87659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0x2fd, 11},
87759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0x5fc, 12},
87859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {  0x1bfc, 14},
87959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {  0x1bfd, 14}
88059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
88159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 3 */
88259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
88359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {     0x5,  5},
88459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x5d,  8},
88559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0x17d, 10},
88659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0x5fd, 12},
88759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0xdfd, 13},
88859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {  0x1dfc, 14},
88959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {  0x1ffd, 15}
89059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    }
89159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
89259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
89359f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable coeff_RVLCtab17[5] =
89459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
89559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 4 */
89659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {     0x8,  5},
89759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {    0x6c,  8},
89859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x37c, 11},
89959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0xefc, 13},
90059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x2ffc, 15}
90159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
90259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
90359f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable coeff_RVLCtab18[3][4] =
90459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
90559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 5 */
90659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
90759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {     0x9,  5},
90859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0xbd,  9},
90959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0x37d, 11},
91059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0xefd, 13}
91159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
91259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 6 */
91359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
91459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {     0xd,  6},
91559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0x1bc, 10},
91659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0x6fc, 12},
91759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {  0x1dfd, 14}
91859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
91959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 7 */
92059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
92159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x14,  6},
92259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0x1bd, 10},
92359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0x6fd, 12},
92459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {  0x2ffd, 15}
92559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    }
92659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
92759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
92859f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable coeff_RVLCtab19[2][3] =
92959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
93059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 8 */
93159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
93259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x15,  6},
93359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0x1dc, 10},
93459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0xf7c, 13}
93559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
93659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 9 */
93759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
93859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x2c,  7},
93959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0x1dd, 10},
94059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {  0x1efc, 14}
94159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    }
94259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
94359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
94459f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable coeff_RVLCtab20[8][2] =
94559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
94659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 10 */
94759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
94859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x2d,  7},
94959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0x3bc, 11}
95059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
95159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 11 */
95259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
95359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x34,  7},
95459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0x77c, 12}
95559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
95659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 12 */
95759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
95859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x6d,  8},
95959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0xf7d, 13}
96059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
96159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 13 */
96259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
96359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x74,  8},
96459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {  0x1efd, 14}
96559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
96659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 14 */
96759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
96859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x75,  8},
96959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {  0x1f7c, 14}
97059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
97159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 15 */
97259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
97359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0xdc,  9},
97459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {  0x1f7d, 14}
97559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
97659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 16 */
97759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
97859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0xdd,  9},
97959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {  0x1fbc, 14}
98059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
98159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 17 */
98259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
98359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0xec,  9},
98459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {  0x37fc, 15}
98559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    }
98659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
98759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
98859f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable coeff_RVLCtab21[21] =
98959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
99059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 18 -> 38 */
99159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x1ec, 10},
99259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x1ed, 10},
99359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x1f4, 10},
99459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x3bd, 11},
99559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x3dc, 11},
99659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x3dd, 11},
99759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x3ec, 11},
99859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x3ed, 11},
99959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x3f4, 11},
100059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x77d, 12},
100159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x7bc, 12},
100259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x7bd, 12},
100359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0xfbc, 13},
100459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0xfbd, 13},
100559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0xfdc, 13},
100659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0xfdd, 13},
100759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x1fbd, 14},
100859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x1fdc, 14},
100959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x1fdd, 14},
101059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x37fd, 15},
101159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x3bfc, 15}
101259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
101359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
101459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
101559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong/* first coeffs of last = 1. indexing by [run][level-1] */
101659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
101759f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable coeff_RVLCtab22[2][5] =
101859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
101959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 0 */
102059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
102159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {     0xb,  4},
102259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x78,  8},
102359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0x3f5, 11},
102459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0xfec, 13},
102559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {  0x1fec, 14}
102659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
102759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 1 */
102859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
102959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x12,  5},
103059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0xed,  9},
103159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0x7dc, 12},
103259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {  0x1fed, 14},
103359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {  0x3bfd, 15}
103459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    }
103559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
103659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
103759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
103859f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable coeff_RVLCtab23[3] =
103959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
104059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 2 */
104159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {    0x13,  5},
104259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x3f8, 11},
104359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x3dfc, 15}
104459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
104559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
104659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
104759f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable coeff_RVLCtab24[11][2] =
104859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
104959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 3 */
105059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
105159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x18,  6},
105259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0x7dd, 12}
105359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
105459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 4 */
105559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
105659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x19,  6},
105759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0x7ec, 12}
105859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
105959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 5 */
106059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
106159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x22,  6},
106259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0xfed, 13}
106359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
106459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 6 */
106559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
106659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x23,  6},
106759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0xff4, 13}
106859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
106959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 7 */
107059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
107159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x35,  7},
107259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0xff5, 13}
107359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
107459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 8 */
107559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
107659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x38,  7},
107759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0xff8, 13}
107859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
107959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 9 */
108059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
108159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x39,  7},
108259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {   0xff9, 13}
108359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
108459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 10 */
108559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
108659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x42,  7},
108759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {  0x1ff4, 14}
108859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
108959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 11 */
109059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
109159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x43,  7},
109259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {  0x1ff5, 14}
109359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
109459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 12 */
109559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
109659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x79,  8},
109759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {  0x1ff8, 14}
109859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    },
109959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 13 */
110059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {
110159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {    0x82,  8},
110259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong        {  0x3dfd, 15}
110359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    }
110459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
110559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
110659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
110759f566c4ec3dfc097ad8163523e522280b27e5c3James Dongstatic const VLCtable coeff_RVLCtab25[32] =
110859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong{
110959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    /* run = 14 -> 44 */
111059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {    0x83,  8},
111159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {    0xf4,  9},
111259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {    0xf5,  9},
111359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {    0xf8,  9},
111459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {    0xf9,  9},
111559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x102,  9},
111659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x103,  9},
111759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x1f5, 10},
111859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x1f8, 10},
111959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x1f9, 10},
112059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x202, 10},
112159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x203, 10},
112259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x3f9, 11},
112359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x402, 11},
112459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x403, 11},
112559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x7ed, 12},
112659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x7f4, 12},
112759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x7f5, 12},
112859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x7f8, 12},
112959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x7f9, 12},
113059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x802, 12},
113159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {   0x803, 12},
113259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x1002, 13},
113359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x1003, 13},
113459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x1ff9, 14},
113559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x2002, 14},
113659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x2003, 14},
113759f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x3efc, 15},
113859f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x3efd, 15},
113959f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x3f7c, 15},
114059f566c4ec3dfc097ad8163523e522280b27e5c3James Dong    {  0x3f7d, 15}
114159f566c4ec3dfc097ad8163523e522280b27e5c3James Dong};
114259f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
114359f566c4ec3dfc097ad8163523e522280b27e5c3James Dong#endif /* NO_RVLC */
114459f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
114559f566c4ec3dfc097ad8163523e522280b27e5c3James Dong#endif /* _VLC_ENC_TAB_H_ */
114659f566c4ec3dfc097ad8163523e522280b27e5c3James Dong
1147