/*
 * Copyright (c) 2011 Intel Corporation. All Rights Reserved.
 * Copyright (c) Imagination Technologies Limited, UK
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sub license, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 *
 * The above copyright notice and this permission notice (including the
 * next paragraph) shall be included in all copies or substantial portions
 * of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
 * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

#ifndef _REGCONV_H_topaz_vlc_regs_h
#define _REGCONV_H_topaz_vlc_regs_h

#ifdef __cplusplus 
#include "img_types.h"
#include "systemc_utils.h"
#endif 


/* Register CR_VLC_CONTROL */
#define TOPAZ_VLC_CR_VLC_CONTROL    0x0000
#define MASK_TOPAZ_VLC_CR_CODEC     0x00000003
#define SHIFT_TOPAZ_VLC_CR_CODEC    0
#define REGNUM_TOPAZ_VLC_CR_CODEC   0x0000
#define SIGNED_TOPAZ_VLC_CR_CODEC   0

#define MASK_TOPAZ_VLC_CR_SLICE_CODING_TYPE 0x0000000C
#define SHIFT_TOPAZ_VLC_CR_SLICE_CODING_TYPE 2
#define REGNUM_TOPAZ_VLC_CR_SLICE_CODING_TYPE 0x0000
#define SIGNED_TOPAZ_VLC_CR_SLICE_CODING_TYPE 0

#define MASK_TOPAZ_VLC_CR_START     0x00000010
#define SHIFT_TOPAZ_VLC_CR_START    4
#define REGNUM_TOPAZ_VLC_CR_START   0x0000
#define SIGNED_TOPAZ_VLC_CR_START   0

#define MASK_TOPAZ_VLC_CR_FLUSH     0x00000020
#define SHIFT_TOPAZ_VLC_CR_FLUSH    5
#define REGNUM_TOPAZ_VLC_CR_FLUSH   0x0000
#define SIGNED_TOPAZ_VLC_CR_FLUSH   0

#define MASK_TOPAZ_VLC_CR_FORCE_SKIP 0x00000040
#define SHIFT_TOPAZ_VLC_CR_FORCE_SKIP 6
#define REGNUM_TOPAZ_VLC_CR_FORCE_SKIP 0x0000
#define SIGNED_TOPAZ_VLC_CR_FORCE_SKIP 0

#define MASK_TOPAZ_VLC_CR_DISABLE_SKIP 0x00000080
#define SHIFT_TOPAZ_VLC_CR_DISABLE_SKIP 7
#define REGNUM_TOPAZ_VLC_CR_DISABLE_SKIP 0x0000
#define SIGNED_TOPAZ_VLC_CR_DISABLE_SKIP 0

#define MASK_TOPAZ_VLC_CR_CABAC_ENABLE 0x00000100
#define SHIFT_TOPAZ_VLC_CR_CABAC_ENABLE 8
#define REGNUM_TOPAZ_VLC_CR_CABAC_ENABLE 0x0000
#define SIGNED_TOPAZ_VLC_CR_CABAC_ENABLE 0

#define MASK_TOPAZ_VLC_CR_VLC_FIELD_CODED 0x00000200
#define SHIFT_TOPAZ_VLC_CR_VLC_FIELD_CODED 9
#define REGNUM_TOPAZ_VLC_CR_VLC_FIELD_CODED 0x0000
#define SIGNED_TOPAZ_VLC_CR_VLC_FIELD_CODED 0

#define MASK_TOPAZ_VLC_CR_VLC_8X8_TRANSFORM 0x00000400
#define SHIFT_TOPAZ_VLC_CR_VLC_8X8_TRANSFORM 10
#define REGNUM_TOPAZ_VLC_CR_VLC_8X8_TRANSFORM 0x0000
#define SIGNED_TOPAZ_VLC_CR_VLC_8X8_TRANSFORM 0

#define MASK_TOPAZ_VLC_CR_VLC_CONSTRAINED_INTRA 0x00000800
#define SHIFT_TOPAZ_VLC_CR_VLC_CONSTRAINED_INTRA 11
#define REGNUM_TOPAZ_VLC_CR_VLC_CONSTRAINED_INTRA 0x0000
#define SIGNED_TOPAZ_VLC_CR_VLC_CONSTRAINED_INTRA 0

#define MASK_TOPAZ_VLC_CR_VLC_SPATIAL_DIRECT 0x00001000
#define SHIFT_TOPAZ_VLC_CR_VLC_SPATIAL_DIRECT 12
#define REGNUM_TOPAZ_VLC_CR_VLC_SPATIAL_DIRECT 0x0000
#define SIGNED_TOPAZ_VLC_CR_VLC_SPATIAL_DIRECT 0

#define MASK_TOPAZ_VLC_CR_VLC_P_REF_IDX 0x00002000
#define SHIFT_TOPAZ_VLC_CR_VLC_P_REF_IDX 13
#define REGNUM_TOPAZ_VLC_CR_VLC_P_REF_IDX 0x0000
#define SIGNED_TOPAZ_VLC_CR_VLC_P_REF_IDX 0

#define MASK_TOPAZ_VLC_CR_DISCARD_CODED_DATA 0x00004000
#define SHIFT_TOPAZ_VLC_CR_DISCARD_CODED_DATA 14
#define REGNUM_TOPAZ_VLC_CR_DISCARD_CODED_DATA 0x0000
#define SIGNED_TOPAZ_VLC_CR_DISCARD_CODED_DATA 0

#define MASK_TOPAZ_VLC_CR_FIELD_SELECT 0x00008000
#define SHIFT_TOPAZ_VLC_CR_FIELD_SELECT 15
#define REGNUM_TOPAZ_VLC_CR_FIELD_SELECT 0x0000
#define SIGNED_TOPAZ_VLC_CR_FIELD_SELECT 0

#define MASK_TOPAZ_VLC_CR_CODEC_EXTEND 0x10000000
#define SHIFT_TOPAZ_VLC_CR_CODEC_EXTEND 28
#define REGNUM_TOPAZ_VLC_CR_CODEC_EXTEND 0x0000
#define SIGNED_TOPAZ_VLC_CR_CODEC_EXTEND 0

/* Register CR_VLC_STATUS */
#define TOPAZ_VLC_CR_VLC_STATUS     0x0004
#define MASK_TOPAZ_VLC_CR_BUSY      0x00000001
#define SHIFT_TOPAZ_VLC_CR_BUSY     0
#define REGNUM_TOPAZ_VLC_CR_BUSY    0x0004
#define SIGNED_TOPAZ_VLC_CR_BUSY    0

#define MASK_TOPAZ_VLC_CR_RECODE_AS_IPCM 0x00000004
#define SHIFT_TOPAZ_VLC_CR_RECODE_AS_IPCM 2
#define REGNUM_TOPAZ_VLC_CR_RECODE_AS_IPCM 0x0004
#define SIGNED_TOPAZ_VLC_CR_RECODE_AS_IPCM 0

/* Register CR_VLC_INFO_0 */
#define TOPAZ_VLC_CR_VLC_INFO_0     0x0008
#define MASK_TOPAZ_VLC_CR_FLUSH_STUFFING_BYTES 0x0003E000
#define SHIFT_TOPAZ_VLC_CR_FLUSH_STUFFING_BYTES 13
#define REGNUM_TOPAZ_VLC_CR_FLUSH_STUFFING_BYTES 0x0008
#define SIGNED_TOPAZ_VLC_CR_FLUSH_STUFFING_BYTES 0

/* Register CR_VLC_INFO_1 */
#define TOPAZ_VLC_CR_VLC_INFO_1     0x000C
#define MASK_TOPAZ_VLC_CR_SKIPPED_MBS_IN_FRAME 0x0000FFFF
#define SHIFT_TOPAZ_VLC_CR_SKIPPED_MBS_IN_FRAME 0
#define REGNUM_TOPAZ_VLC_CR_SKIPPED_MBS_IN_FRAME 0x000C
#define SIGNED_TOPAZ_VLC_CR_SKIPPED_MBS_IN_FRAME 0

#define MASK_TOPAZ_VLC_CR_CODED_MBS_IN_FRAME 0xFFFF0000
#define SHIFT_TOPAZ_VLC_CR_CODED_MBS_IN_FRAME 16
#define REGNUM_TOPAZ_VLC_CR_CODED_MBS_IN_FRAME 0x000C
#define SIGNED_TOPAZ_VLC_CR_CODED_MBS_IN_FRAME 0

/* Register CR_VLC_INFO_2 */
#define TOPAZ_VLC_CR_VLC_INFO_2     0x0010
#define MASK_TOPAZ_VLC_CR_INTRA_MBS_IN_FRAME 0x0000FFFF
#define SHIFT_TOPAZ_VLC_CR_INTRA_MBS_IN_FRAME 0
#define REGNUM_TOPAZ_VLC_CR_INTRA_MBS_IN_FRAME 0x0010
#define SIGNED_TOPAZ_VLC_CR_INTRA_MBS_IN_FRAME 0

#define MASK_TOPAZ_VLC_CR_INTER_MBS_IN_FRAME 0xFFFF0000
#define SHIFT_TOPAZ_VLC_CR_INTER_MBS_IN_FRAME 16
#define REGNUM_TOPAZ_VLC_CR_INTER_MBS_IN_FRAME 0x0010
#define SIGNED_TOPAZ_VLC_CR_INTER_MBS_IN_FRAME 0

/* Register CR_VLC_STUFF_HEAD_CTRL */
#define TOPAZ_VLC_CR_VLC_STUFF_HEAD_CTRL 0x0014
#define MASK_TOPAZ_VLC_CR_HEADER_ELEMENTS 0x0000001F
#define SHIFT_TOPAZ_VLC_CR_HEADER_ELEMENTS 0
#define REGNUM_TOPAZ_VLC_CR_HEADER_ELEMENTS 0x0014
#define SIGNED_TOPAZ_VLC_CR_HEADER_ELEMENTS 0

#define MASK_TOPAZ_VLC_CR_STUFFING_WORDS 0x00003FE0
#define SHIFT_TOPAZ_VLC_CR_STUFFING_WORDS 5
#define REGNUM_TOPAZ_VLC_CR_STUFFING_WORDS 0x0014
#define SIGNED_TOPAZ_VLC_CR_STUFFING_WORDS 0

#define MASK_TOPAZ_VLC_CR_CLEAR_HEADER_FIFO 0x80000000
#define SHIFT_TOPAZ_VLC_CR_CLEAR_HEADER_FIFO 31
#define REGNUM_TOPAZ_VLC_CR_CLEAR_HEADER_FIFO 0x0014
#define SIGNED_TOPAZ_VLC_CR_CLEAR_HEADER_FIFO 0

/* Register CR_VLC_HEADER_FIFO */
#define TOPAZ_VLC_CR_VLC_HEADER_FIFO 0x0018
#define MASK_TOPAZ_VLC_CR_HEADER_DATA 0xFFFFFFFF
#define SHIFT_TOPAZ_VLC_CR_HEADER_DATA 0
#define REGNUM_TOPAZ_VLC_CR_HEADER_DATA 0x0018
#define SIGNED_TOPAZ_VLC_CR_HEADER_DATA 0

/* Register CR_VLC_HEADER_CTRL */
#define TOPAZ_VLC_CR_VLC_HEADER_CTRL 0x001C
#define MASK_TOPAZ_VLC_CR_HEADER_PREFIX 0x7FFFFFFF
#define SHIFT_TOPAZ_VLC_CR_HEADER_PREFIX 0
#define REGNUM_TOPAZ_VLC_CR_HEADER_PREFIX 0x001C
#define SIGNED_TOPAZ_VLC_CR_HEADER_PREFIX 0

#define MASK_TOPAZ_VLC_CR_DISABLE_PREFIX_DETECTION 0x80000000
#define SHIFT_TOPAZ_VLC_CR_DISABLE_PREFIX_DETECTION 31
#define REGNUM_TOPAZ_VLC_CR_DISABLE_PREFIX_DETECTION 0x001C
#define SIGNED_TOPAZ_VLC_CR_DISABLE_PREFIX_DETECTION 0

/* Register CR_VLC_HEADER_STATUS */
#define TOPAZ_VLC_CR_VLC_HEADER_STATUS 0x0020
#define MASK_TOPAZ_VLC_CR_HEADER_FIFO_FULL 0x00000001
#define SHIFT_TOPAZ_VLC_CR_HEADER_FIFO_FULL 0
#define REGNUM_TOPAZ_VLC_CR_HEADER_FIFO_FULL 0x0020
#define SIGNED_TOPAZ_VLC_CR_HEADER_FIFO_FULL 0

/* Register CR_VLC_RATE_CTRL_MB_TYPE */
#define TOPAZ_VLC_CR_VLC_RATE_CTRL_MB_TYPE 0x0024
#define MASK_TOPAZ_VLC_CR_MB_CODING_TYPE_P 0x000000FF
#define SHIFT_TOPAZ_VLC_CR_MB_CODING_TYPE_P 0
#define REGNUM_TOPAZ_VLC_CR_MB_CODING_TYPE_P 0x0024
#define SIGNED_TOPAZ_VLC_CR_MB_CODING_TYPE_P 0

#define MASK_TOPAZ_VLC_CR_MB_CODING_TYPE_I 0x0000FF00
#define SHIFT_TOPAZ_VLC_CR_MB_CODING_TYPE_I 8
#define REGNUM_TOPAZ_VLC_CR_MB_CODING_TYPE_I 0x0024
#define SIGNED_TOPAZ_VLC_CR_MB_CODING_TYPE_I 0

#define MASK_TOPAZ_VLC_CR_MB_CODING_TYPE_B 0x00FF0000
#define SHIFT_TOPAZ_VLC_CR_MB_CODING_TYPE_B 16
#define REGNUM_TOPAZ_VLC_CR_MB_CODING_TYPE_B 0x0024
#define SIGNED_TOPAZ_VLC_CR_MB_CODING_TYPE_B 0

#define MASK_TOPAZ_VLC_CR_MB_CODING_TYPE_SKIP 0xFF000000
#define SHIFT_TOPAZ_VLC_CR_MB_CODING_TYPE_SKIP 24
#define REGNUM_TOPAZ_VLC_CR_MB_CODING_TYPE_SKIP 0x0024
#define SIGNED_TOPAZ_VLC_CR_MB_CODING_TYPE_SKIP 0

/* Register CR_VLC_RATE_CTRL_DCBITS */
#define TOPAZ_VLC_CR_VLC_RATE_CTRL_DCBITS 0x0028
#define MASK_TOPAZ_VLC_CR_DC_BITS   0x0000FFFF
#define SHIFT_TOPAZ_VLC_CR_DC_BITS  0
#define REGNUM_TOPAZ_VLC_CR_DC_BITS 0x0028
#define SIGNED_TOPAZ_VLC_CR_DC_BITS 0

#define MASK_TOPAZ_VLC_CR_MB_CODING_IPCM 0xFF000000
#define SHIFT_TOPAZ_VLC_CR_MB_CODING_IPCM 24
#define REGNUM_TOPAZ_VLC_CR_MB_CODING_IPCM 0x0028
#define SIGNED_TOPAZ_VLC_CR_MB_CODING_IPCM 0

/* Register CR_VLC_RATE_CTRL_MVBITS */
#define TOPAZ_VLC_CR_VLC_RATE_CTRL_MVBITS 0x002C
#define MASK_TOPAZ_VLC_CR_MV_BITS   0x00FFFFFF
#define SHIFT_TOPAZ_VLC_CR_MV_BITS  0
#define REGNUM_TOPAZ_VLC_CR_MV_BITS 0x002C
#define SIGNED_TOPAZ_VLC_CR_MV_BITS 0

/* Register CR_VLC_RATE_CTRL_MBSYM */
#define TOPAZ_VLC_CR_VLC_RATE_CTRL_MBSYM 0x0030
#define MASK_TOPAZ_VLC_CR_MB_SYMBOLS_BITS 0x00FFFFFF
#define SHIFT_TOPAZ_VLC_CR_MB_SYMBOLS_BITS 0
#define REGNUM_TOPAZ_VLC_CR_MB_SYMBOLS_BITS 0x0030
#define SIGNED_TOPAZ_VLC_CR_MB_SYMBOLS_BITS 0

/* Register CR_VLC_RATE_CTRL_MBRES */
#define TOPAZ_VLC_CR_VLC_RATE_CTRL_MBRES 0x0034
#define MASK_TOPAZ_VLC_CR_MB_RESIDUAL_BITS 0x00FFFFFF
#define SHIFT_TOPAZ_VLC_CR_MB_RESIDUAL_BITS 0
#define REGNUM_TOPAZ_VLC_CR_MB_RESIDUAL_BITS 0x0034
#define SIGNED_TOPAZ_VLC_CR_MB_RESIDUAL_BITS 0

/* Register CR_VLC_SIGNATURE_0 */
#define TOPAZ_VLC_CR_VLC_SIGNATURE_0 0x0038
#define MASK_TOPAZ_VLC_CR_MB_SIGNATURE 0xFFFFFFFF
#define SHIFT_TOPAZ_VLC_CR_MB_SIGNATURE 0
#define REGNUM_TOPAZ_VLC_CR_MB_SIGNATURE 0x0038
#define SIGNED_TOPAZ_VLC_CR_MB_SIGNATURE 0

/* Register CR_VLC_SIGNATURE_1 */
#define TOPAZ_VLC_CR_VLC_SIGNATURE_1 0x003C
#define MASK_TOPAZ_VLC_CR_BLK_SIGNATURE 0xFFFFFFFF
#define SHIFT_TOPAZ_VLC_CR_BLK_SIGNATURE 0
#define REGNUM_TOPAZ_VLC_CR_BLK_SIGNATURE 0x003C
#define SIGNED_TOPAZ_VLC_CR_BLK_SIGNATURE 0

/* Register CR_VLC_SIGNATURE_2 */
#define TOPAZ_VLC_CR_VLC_SIGNATURE_2 0x0040
#define MASK_TOPAZ_VLC_CR_LOOKUP_SIGNATURE 0xFFFFFFFF
#define SHIFT_TOPAZ_VLC_CR_LOOKUP_SIGNATURE 0
#define REGNUM_TOPAZ_VLC_CR_LOOKUP_SIGNATURE 0x0040
#define SIGNED_TOPAZ_VLC_CR_LOOKUP_SIGNATURE 0

/* Register CR_VLC_SIGNATURE_3 */
#define TOPAZ_VLC_CR_VLC_SIGNATURE_3 0x0044
#define MASK_TOPAZ_VLC_CR_BITSTREAM_SIGNATURE 0xFFFFFFFF
#define SHIFT_TOPAZ_VLC_CR_BITSTREAM_SIGNATURE 0
#define REGNUM_TOPAZ_VLC_CR_BITSTREAM_SIGNATURE 0x0044
#define SIGNED_TOPAZ_VLC_CR_BITSTREAM_SIGNATURE 0

/* Register CR_VLC_SIGNATURE_4 */
#define TOPAZ_VLC_CR_VLC_SIGNATURE_4 0x0048
#define MASK_TOPAZ_VLC_CR_HEADER_SIGNATURE 0xFFFFFFFF
#define SHIFT_TOPAZ_VLC_CR_HEADER_SIGNATURE 0
#define REGNUM_TOPAZ_VLC_CR_HEADER_SIGNATURE 0x0048
#define SIGNED_TOPAZ_VLC_CR_HEADER_SIGNATURE 0

/* Register CR_VLC_PERFORMANCE_0 */
#define TOPAZ_VLC_CR_VLC_PERFORMANCE_0 0x0050
#define MASK_TOPAZ_VLC_CR_WORST_MB_CYCLES 0x0000FFFF
#define SHIFT_TOPAZ_VLC_CR_WORST_MB_CYCLES 0
#define REGNUM_TOPAZ_VLC_CR_WORST_MB_CYCLES 0x0050
#define SIGNED_TOPAZ_VLC_CR_WORST_MB_CYCLES 0

#define MASK_TOPAZ_VLC_CR_WORST_MB_TYPE 0x00030000
#define SHIFT_TOPAZ_VLC_CR_WORST_MB_TYPE 16
#define REGNUM_TOPAZ_VLC_CR_WORST_MB_TYPE 0x0050
#define SIGNED_TOPAZ_VLC_CR_WORST_MB_TYPE 0

#define MASK_TOPAZ_VLC_CR_WORST_MB_IPCM 0x00040000
#define SHIFT_TOPAZ_VLC_CR_WORST_MB_IPCM 18
#define REGNUM_TOPAZ_VLC_CR_WORST_MB_IPCM 0x0050
#define SIGNED_TOPAZ_VLC_CR_WORST_MB_IPCM 0

/* Register CR_VLC_PERFORMANCE_1 */
#define TOPAZ_VLC_CR_VLC_PERFORMANCE_1 0x0054
#define MASK_TOPAZ_VLC_CR_WORST_MB_NUM 0x003FFFFF
#define SHIFT_TOPAZ_VLC_CR_WORST_MB_NUM 0
#define REGNUM_TOPAZ_VLC_CR_WORST_MB_NUM 0x0054
#define SIGNED_TOPAZ_VLC_CR_WORST_MB_NUM 0

/* Register CR_VLC_PERFORMANCE_2 */
#define TOPAZ_VLC_CR_VLC_PERFORMANCE_2 0x0058
#define MASK_TOPAZ_VLC_CR_WORST_MB_RESET 0x00000001
#define SHIFT_TOPAZ_VLC_CR_WORST_MB_RESET 0
#define REGNUM_TOPAZ_VLC_CR_WORST_MB_RESET 0x0058
#define SIGNED_TOPAZ_VLC_CR_WORST_MB_RESET 0

#define MASK_TOPAZ_VLC_CR_DISABLE_COUNTERS 0x00000002
#define SHIFT_TOPAZ_VLC_CR_DISABLE_COUNTERS 1
#define REGNUM_TOPAZ_VLC_CR_DISABLE_COUNTERS 0x0058
#define SIGNED_TOPAZ_VLC_CR_DISABLE_COUNTERS 0

/* Register CR_VLC_IPCM_0 */
#define TOPAZ_VLC_CR_VLC_IPCM_0     0x005C
#define MASK_TOPAZ_VLC_CR_CABAC_DB_MARGIN 0x03FF0000
#define SHIFT_TOPAZ_VLC_CR_CABAC_DB_MARGIN 16
#define REGNUM_TOPAZ_VLC_CR_CABAC_DB_MARGIN 0x005C
#define SIGNED_TOPAZ_VLC_CR_CABAC_DB_MARGIN 0

#define MASK_TOPAZ_VLC_CR_CABAC_BIN_FLEX 0x00001FFF
#define SHIFT_TOPAZ_VLC_CR_CABAC_BIN_FLEX 0
#define REGNUM_TOPAZ_VLC_CR_CABAC_BIN_FLEX 0x005C
#define SIGNED_TOPAZ_VLC_CR_CABAC_BIN_FLEX 0

/* Register CR_VLC_IPCM_1 */
#define TOPAZ_VLC_CR_VLC_IPCM_1     0x0060
#define MASK_TOPAZ_VLC_CR_IPCM_THRESHOLD 0x00000FFF
#define SHIFT_TOPAZ_VLC_CR_IPCM_THRESHOLD 0
#define REGNUM_TOPAZ_VLC_CR_IPCM_THRESHOLD 0x0060
#define SIGNED_TOPAZ_VLC_CR_IPCM_THRESHOLD 0

#define MASK_TOPAZ_VLC_CR_CABAC_BIN_LIMIT 0x1FFF0000
#define SHIFT_TOPAZ_VLC_CR_CABAC_BIN_LIMIT 16
#define REGNUM_TOPAZ_VLC_CR_CABAC_BIN_LIMIT 0x0060
#define SIGNED_TOPAZ_VLC_CR_CABAC_BIN_LIMIT 0

/* Register CR_VLC_MPEG4_CFG */
#define TOPAZ_VLC_CR_VLC_MPEG4_CFG  0x0064
#define MASK_TOPAZ_VLC_CR_RSIZE     0x00000007
#define SHIFT_TOPAZ_VLC_CR_RSIZE    0
#define REGNUM_TOPAZ_VLC_CR_RSIZE   0x0064
#define SIGNED_TOPAZ_VLC_CR_RSIZE   0

/* Register CR_VLC_MB_PARAMS */
#define TOPAZ_VLC_CR_VLC_MB_PARAMS  0x0068
#define MASK_TOPAZ_VLC_CR_QP        0x0000003F
#define SHIFT_TOPAZ_VLC_CR_QP       0
#define REGNUM_TOPAZ_VLC_CR_QP      0x0068
#define SIGNED_TOPAZ_VLC_CR_QP      0

#define MASK_TOPAZ_VLC_CR_QP_CB     0x003F0000
#define SHIFT_TOPAZ_VLC_CR_QP_CB    16
#define REGNUM_TOPAZ_VLC_CR_QP_CB   0x0068
#define SIGNED_TOPAZ_VLC_CR_QP_CB   0

#define MASK_TOPAZ_VLC_CR_QP_CR     0x3F000000
#define SHIFT_TOPAZ_VLC_CR_QP_CR    24
#define REGNUM_TOPAZ_VLC_CR_QP_CR   0x0068
#define SIGNED_TOPAZ_VLC_CR_QP_CR   0

/* Register CR_VLC_RESET */
#define TOPAZ_VLC_CR_VLC_RESET      0x006C
#define MASK_TOPAZ_VLC_CR_RESET     0x00000001
#define SHIFT_TOPAZ_VLC_CR_RESET    0
#define REGNUM_TOPAZ_VLC_CR_RESET   0x006C
#define SIGNED_TOPAZ_VLC_CR_RESET   0

/* Register CR_VLC_WRITE_ADDR */
#define TOPAZ_VLC_CR_VLC_WRITE_ADDR 0x0070
#define MASK_TOPAZ_VLC_CR_NEXT_WRITE_ADDR 0xFFFFFFF0
#define SHIFT_TOPAZ_VLC_CR_NEXT_WRITE_ADDR 4
#define REGNUM_TOPAZ_VLC_CR_NEXT_WRITE_ADDR 0x0070
#define SIGNED_TOPAZ_VLC_CR_NEXT_WRITE_ADDR 0

/* Register CR_VLC_CHROMA_QP_OFFSET */
#define TOPAZ_VLC_CR_VLC_CHROMA_QP_OFFSET 0x0074
#define MASK_TOPAZ_VLC_CR_QPCB_OFFSET 0x0000001F
#define SHIFT_TOPAZ_VLC_CR_QPCB_OFFSET 0
#define REGNUM_TOPAZ_VLC_CR_QPCB_OFFSET 0x0074
#define SIGNED_TOPAZ_VLC_CR_QPCB_OFFSET 0

#define MASK_TOPAZ_VLC_CR_QPCR_OFFSET 0x00001F00
#define SHIFT_TOPAZ_VLC_CR_QPCR_OFFSET 8
#define REGNUM_TOPAZ_VLC_CR_QPCR_OFFSET 0x0074
#define SIGNED_TOPAZ_VLC_CR_QPCR_OFFSET 0

/* Register CR_VLC_RATE_CTRL_QP */
#define TOPAZ_VLC_CR_VLC_RATE_CTRL_QP 0x0078
#define MASK_TOPAZ_VLC_CR_BU_QPY_INTRA 0x00003FFF
#define SHIFT_TOPAZ_VLC_CR_BU_QPY_INTRA 0
#define REGNUM_TOPAZ_VLC_CR_BU_QPY_INTRA 0x0078
#define SIGNED_TOPAZ_VLC_CR_BU_QPY_INTRA 0

#define MASK_TOPAZ_VLC_CR_BU_QPY_INTER 0x3FFF0000
#define SHIFT_TOPAZ_VLC_CR_BU_QPY_INTER 16
#define REGNUM_TOPAZ_VLC_CR_BU_QPY_INTER 0x0078
#define SIGNED_TOPAZ_VLC_CR_BU_QPY_INTER 0

/* Register CR_VLC_BU_STAT_UPDATE */
#define TOPAZ_VLC_CR_VLC_BU_STAT_UPDATE 0x007C
#define MASK_TOPAZ_VLC_CR_FORCE_BU_STAT_UPDATE 0x00000001
#define SHIFT_TOPAZ_VLC_CR_FORCE_BU_STAT_UPDATE 0
#define REGNUM_TOPAZ_VLC_CR_FORCE_BU_STAT_UPDATE 0x007C
#define SIGNED_TOPAZ_VLC_CR_FORCE_BU_STAT_UPDATE 0

/* Register CR_VLC_SLICE_HEADER_CTRL */
#define TOPAZ_VLC_CR_VLC_SLICE_HEADER_CTRL 0x0080
#define MASK_TOPAZ_VLC_CR_SLICE_HEADER_ELEMENTS 0x0000001F
#define SHIFT_TOPAZ_VLC_CR_SLICE_HEADER_ELEMENTS 0
#define REGNUM_TOPAZ_VLC_CR_SLICE_HEADER_ELEMENTS 0x0080
#define SIGNED_TOPAZ_VLC_CR_SLICE_HEADER_ELEMENTS 0

#define MASK_TOPAZ_VLC_CR_SLICE_PREFIX_ELEMENTS 0x00001F00
#define SHIFT_TOPAZ_VLC_CR_SLICE_PREFIX_ELEMENTS 8
#define REGNUM_TOPAZ_VLC_CR_SLICE_PREFIX_ELEMENTS 0x0080
#define SIGNED_TOPAZ_VLC_CR_SLICE_PREFIX_ELEMENTS 0

#define MASK_TOPAZ_VLC_CR_SLICE_MB_NUM 0x3FFF0000
#define SHIFT_TOPAZ_VLC_CR_SLICE_MB_NUM 16
#define REGNUM_TOPAZ_VLC_CR_SLICE_MB_NUM 0x0080
#define SIGNED_TOPAZ_VLC_CR_SLICE_MB_NUM 0

/* Register CR_VLC_SLICE_CTRL_0 */
#define TOPAZ_VLC_CR_VLC_SLICE_CTRL_0 0x0084
#define MASK_TOPAZ_VLC_CR_SLICE_SIZE_LIMIT 0x00FFFFFF
#define SHIFT_TOPAZ_VLC_CR_SLICE_SIZE_LIMIT 0
#define REGNUM_TOPAZ_VLC_CR_SLICE_SIZE_LIMIT 0x0084
#define SIGNED_TOPAZ_VLC_CR_SLICE_SIZE_LIMIT 0

/* Register CR_VLC_SLICE_CTRL_1 */
#define TOPAZ_VLC_CR_VLC_SLICE_CTRL_1 0x008C
#define MASK_TOPAZ_VLC_CR_SLICE_MBS_LIMIT 0x00003FFF
#define SHIFT_TOPAZ_VLC_CR_SLICE_MBS_LIMIT 0
#define REGNUM_TOPAZ_VLC_CR_SLICE_MBS_LIMIT 0x008C
#define SIGNED_TOPAZ_VLC_CR_SLICE_MBS_LIMIT 0

/* Register CR_VLC_RATE_CTRL_HEADERS */
#define TOPAZ_VLC_CR_VLC_RATE_CTRL_HEADERS 0x0090
#define MASK_TOPAZ_VLC_CR_SLICE_HEADER_BITS 0x00FFFFFF
#define SHIFT_TOPAZ_VLC_CR_SLICE_HEADER_BITS 0
#define REGNUM_TOPAZ_VLC_CR_SLICE_HEADER_BITS 0x0090
#define SIGNED_TOPAZ_VLC_CR_SLICE_HEADER_BITS 0

/* Register CR_VLC_SIGNATURE_5 */
#define TOPAZ_VLC_CR_VLC_SIGNATURE_5 0x0094
#define MASK_TOPAZ_VLC_CR_CABAC_SIGNATURE 0xFFFFFFFF
#define SHIFT_TOPAZ_VLC_CR_CABAC_SIGNATURE 0
#define REGNUM_TOPAZ_VLC_CR_CABAC_SIGNATURE 0x0094
#define SIGNED_TOPAZ_VLC_CR_CABAC_SIGNATURE 0

/* Register CR_VLC_SIGNATURE_6 */
#define TOPAZ_VLC_CR_VLC_SIGNATURE_6 0x0098
#define MASK_TOPAZ_VLC_CR_IPCM_SIGNATURE 0xFFFFFFFF
#define SHIFT_TOPAZ_VLC_CR_IPCM_SIGNATURE 0
#define REGNUM_TOPAZ_VLC_CR_IPCM_SIGNATURE 0x0098
#define SIGNED_TOPAZ_VLC_CR_IPCM_SIGNATURE 0

/*
	Byte range covering the group TOPAZ_VLC file
*/

#define TOPAZ_VLC_TOPAZ_VLC_REGISTERS_START		0x00000000
#define TOPAZ_VLC_TOPAZ_VLC_REGISTERS_END  		0x0000009B

/*
	Byte range covering the whole register file
*/

#define TOPAZ_VLC_REGISTERS_START		0x00000000
#define TOPAZ_VLC_REGISTERS_END  		0x0000009B
#define TOPAZ_VLC_REG_DEFAULT_TABLE struct {\
			IMG_UINT16 uRegOffset;\
			IMG_UINT32 uRegDefault;\
			IMG_UINT32 uRegMask;\
			bool bReadonly;\
			const char* pszName;\
		} TOPAZ_VLC_Defaults[] = {\
	{0x0000, 0x00000000, 0x1000FFFF, 0, "CR_VLC_CONTROL" } ,\
	{0x0004, 0x00000000, 0x00000005, 1, "CR_VLC_STATUS" } ,\
	{0x0008, 0x00000000, 0x0003E000, 1, "CR_VLC_INFO_0" } ,\
	{0x000C, 0x00000000, 0xFFFFFFFF, 0, "CR_VLC_INFO_1" } ,\
	{0x0010, 0x00000000, 0xFFFFFFFF, 0, "CR_VLC_INFO_2" } ,\
	{0x0014, 0x00000000, 0x80003FFF, 0, "CR_VLC_STUFF_HEAD_CTRL" } ,\
	{0x0018, 0x00000000, 0xFFFFFFFF, 0, "CR_VLC_HEADER_FIFO" } ,\
	{0x001C, 0x00000000, 0xFFFFFFFF, 0, "CR_VLC_HEADER_CTRL" } ,\
	{0x0020, 0x00000000, 0x00000001, 1, "CR_VLC_HEADER_STATUS" } ,\
	{0x0024, 0x00000000, 0xFFFFFFFF, 1, "CR_VLC_RATE_CTRL_MB_TYPE" } ,\
	{0x0028, 0x00000000, 0xFF00FFFF, 1, "CR_VLC_RATE_CTRL_DCBITS" } ,\
	{0x002C, 0x00000000, 0x00FFFFFF, 1, "CR_VLC_RATE_CTRL_MVBITS" } ,\
	{0x0030, 0x00000000, 0x00FFFFFF, 1, "CR_VLC_RATE_CTRL_MBSYM" } ,\
	{0x0034, 0x00000000, 0x00FFFFFF, 1, "CR_VLC_RATE_CTRL_MBRES" } ,\
	{0x0038, 0x00000000, 0xFFFFFFFF, 1, "CR_VLC_SIGNATURE_0" } ,\
	{0x003C, 0x00000000, 0xFFFFFFFF, 1, "CR_VLC_SIGNATURE_1" } ,\
	{0x0040, 0x00000000, 0xFFFFFFFF, 1, "CR_VLC_SIGNATURE_2" } ,\
	{0x0044, 0x00000000, 0xFFFFFFFF, 1, "CR_VLC_SIGNATURE_3" } ,\
	{0x0048, 0x00000000, 0xFFFFFFFF, 1, "CR_VLC_SIGNATURE_4" } ,\
	{0x0050, 0x00000000, 0x0007FFFF, 0, "CR_VLC_PERFORMANCE_0" } ,\
	{0x0054, 0x00000000, 0x003FFFFF, 0, "CR_VLC_PERFORMANCE_1" } ,\
	{0x0058, 0x00000000, 0x00000003, 0, "CR_VLC_PERFORMANCE_2" } ,\
	{0x005C, 0x01900000, 0x03FF1FFF, 0, "CR_VLC_IPCM_0" } ,\
	{0x0060, 0x00000000, 0x1FFF0FFF, 0, "CR_VLC_IPCM_1" } ,\
	{0x0064, 0x00000000, 0x00000007, 0, "CR_VLC_MPEG4_CFG" } ,\
	{0x0068, 0x00000000, 0x3F3F003F, 1, "CR_VLC_MB_PARAMS" } ,\
	{0x006C, 0x00000000, 0x00000001, 0, "CR_VLC_RESET" } ,\
	{0x0070, 0x00000000, 0xFFFFFFF0, 0, "CR_VLC_WRITE_ADDR" } ,\
	{0x0074, 0x00000000, 0x00001F1F, 0, "CR_VLC_CHROMA_QP_OFFSET" } ,\
	{0x0078, 0x00000000, 0x3FFF3FFF, 1, "CR_VLC_RATE_CTRL_QP" } ,\
	{0x007C, 0x00000000, 0x00000001, 0, "CR_VLC_BU_STAT_UPDATE" } ,\
	{0x0080, 0x00000000, 0x3FFF1F1F, 0, "CR_VLC_SLICE_HEADER_CTRL" } ,\
	{0x0084, 0x00000000, 0x00FFFFFF, 0, "CR_VLC_SLICE_CTRL_0" } ,\
	{0x008C, 0x00000000, 0x00003FFF, 0, "CR_VLC_SLICE_CTRL_1" } ,\
	{0x0090, 0x00000000, 0x00FFFFFF, 1, "CR_VLC_RATE_CTRL_HEADERS" } ,\
	{0x0094, 0x00000000, 0xFFFFFFFF, 1, "CR_VLC_SIGNATURE_5" } ,\
	{0x0098, 0x00000000, 0xFFFFFFFF, 1, "CR_VLC_SIGNATURE_6" } ,\
{ 0 }}

#define TOPAZ_VLC_REGS_INIT(uBase) \
	{ \
		int n;\
		TOPAZ_VLC_REG_DEFAULT_TABLE;\
		for (n = 0; n < sizeof(TOPAZ_VLC_Defaults)/ sizeof(TOPAZ_VLC_Defaults[0] ) -1; n++)\
		{\
			RegWriteNoTrap(TOPAZ_VLC_Defaults[n].uRegOffset + uBase, TOPAZ_VLC_Defaults[n].uRegDefault); \
		}\
	}
#endif