ScPadAlloc.h
上传用户:super_houu
上传日期:2008-09-21
资源大小:4099k
文件大小:14k
- /****************************************************************************************
- * Copyright (c) 2002 ZORAN Corporation, All Rights Reserved
- * THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ZORAN CORPORATION
- *
- * File: $Workfile: ScPadAlloc.h $
- *
- * Description:
- * ============
- *
- *
- * Log:
- * ====
- * $Revision: 42 $
- * Last Modified by $Author: Glenl $ at $Modtime: 2/20/04 4:22p $
- ****************************************************************************************
- * Updates:
- ****************************************************************************************
- * $Log: /I76/I76_Common/I76_Reference/Playcore/ScPad/ScPadAlloc.h $
- *
- * 42 2/20/04 6:23p Glenl
- * Merged S1 code
- *
- * 41 04-02-19 17:58 Jerryc
- * add sacd code
- *
- * 40 2/11/04 12:42a Lotan
- * new Divx DRM handling method.
- *
- * 39 13/01/04 16:31 Lotan
- * update subtitles -> move variables to scratch-pad
- *
- * 38 1/05/04 12:26p Fwang
- *
- * 37 12/31/03 2:14p Fwang
- * Add AVI display menu.
- *
- * 36 11/20/03 18:52 Eyalr
- *
- * 35 11/15/03 7:11p Leslie
- * Remove DVD_AUDIO_SUPPORT compile switch to make the code compileable
- *
- * 34 11/15/03 1:01p Leonh
- * Angieh:add support for display menu.
- *
- * 33 11/06/03 15:12 Eyalr
- * added DivXIndexTable
- *
- * 32 11/06/03 11:17a Chaol
- * moved SC_CDTOC_ADDR start address
- *
- * 31 11/01/03 10:33a Chaol
- * add DVD-Audio downmix coefficients table address in SC-Pad
- *
- * 30 03-07-09 10:23 Leonh
- * cache enable
- *
- * 29 03-06-11 17:02 Frankm
- * Add support for 5000 clips.
- *
- * 28 03-06-02 21:42 Leonh
- *
- * 27 03-03-21 16:20 Jerryc
- * define MAX_PROGLIST_ENTRIES as CLIPS_MAX_PROGRAM_SIZE.
- *
- * 26 03-03-20 11:47 Jerryc
- * support 1500 clips and 300 dirs.
- *
- * 25 3/19/03 3:45p Rinata
- * fix define of SC_CLIPS_LIST_ADDRESS
- *
- * 22 03-03-04 11:38 Jerryc
- * jerry cai, merge new nav clips lib.
- *
- * 21 03-02-14 11:45 Victorwu
- * Correct the clips list address.
- *
- * 20 03-02-08 0:40 Leslie
- * Increase Clip Dir size
- *
- * 19 03-02-06 14:20 Leslie
- * Change the SC_CLIPS_LIST_ADDRESS to Sc-Pad Area(414K - 218K)
- *
- * 18 03-01-30 23:12 Leslie
- * Change SC_CLIPSDIR_LIST_ADDRESS
- *
- * 17 03-01-14 1:41 Leslie
- * Allocate Statci SC for BitRate info/String display
- *
- * 16 03-01-09 19:01 Royz
- *
- * 15 03-01-09 17:00 Royz
- * add some definition for VESTEL search menu
- *
- * 14 03-01-09 4:46 Leslie
- * Code cleanup
- * Support for unicode
- *
- * 13 12/31/02 2:19p Leslie
- * Change the address for SC_CLIPS_LIST_ADDRESS
- *
- * 12 12/18/02 12:25p Leslie
- * Change SC_CLIPS_LIST_ADDRESS
- *
- * 11 12/09/02 6:17p Leslie
- * Code cleanup
- *
- * 10 11/12/02 3:04p Leslie
- * Change the value of SC_CLIPS_LIST_ADDRESS
- *
- * 9 11/07/02 9:40p Leslie
- * Different SC_CLIPS_LIST_ADDRESS value for 32M/64M SDRAM address
- * mapping
- *
- * 8 3/06/02 19:59 Nirm
- * - Moved SC_CLIPS_LIST_ADDRESS to ScPadAlloc.h
- *
- * 7 26/05/02 17:23 Ettim
- * Using the extended address mode and setting the file list size to 500
- * files.
- *
- * 6 9/05/02 16:17 Nirm
- * - Moved CGMS-Table allocation to inside the DVD Navigator.
- *
- * 5 5/06/02 17:47 Rinata
- * increase NUM_OF_LINE21DATA_BUFFER_POOL to 8
- *
- * 4 4/30/02 17:27 Rinata
- * update MAX_VOB_FILES for 16M SDRAM
- *
- * 3 4/30/02 17:11 Rinata
- * CGMS/WSS support
- *
- * 2 23/04/02 9:36 Nirm
- * - Added dependency in "Config.h".
- *
- * 1 4/03/02 18:11 Nirm
- ****************************************************************************************/
- #include "Config.h" // Global Configuration - do not remove!
- #ifndef __SCPADALLOC_H_
- #define __SCPADALLOC_H_
- #include "PlaycoreAuxCacheAuxCache.h"
- #ifdef DISC_CACHE_ENABLE
- #include "PlaycoreScPadcachemgr.h"
- #endif
- #include "decoder_settingsdram_config.h"
- #include "playcoreNav_clipsClip_Impl.h" //ZKR JK0426 : for compile error
- #include "playcoreNav_clipsnav_clips.h"
- #include "PlaycoreAuxCacheAuxCache.h"
- #include "PlaycoreScPadscllmgr.h"
- #include "PlaycoreFilesysFileSystem_impl.h"
- /////////////////////////////////////////////////////////////////////////////
- // Scratch-Pad Static Allocations
- /////////////////////////////////////////////////////////////////////////////
- // Common Memory Allocations, relative to the beginning of the Scratch-Pad.
- // All addresses are expressed in DWORD units.
- /////////////////////////////////////////////////////////////////////////////
- // Unshared Memory Segments
- //
- // The following memory-segments inside the Scratch-Pad are dedicated to a
- // specific purpose, pre-defined at compile-time.
- // Scratch-Pad Cache
- #ifdef DVD_VR_SUPPORT
- #define SC_CACHEREC_ADDR 0x2000 //32KB, the position is behind the dynamic memory
- #else
- #define SC_CACHEREC_ADDR 0
- #endif
- // Global Program-List
- #ifdef USE_2ND_32MSDRAM_FOR_CLIPS
- #define MAX_PROGLIST_ENTRIES 5000
- #else
- #define MAX_PROGLIST_ENTRIES CLIPS_MAX_PROGRAM_SIZE
- #endif//USE_2ND_32MSDRAM_FOR_CLIPS
- #define SC_PROGLIST_ADDR SC_CACHEREC_ADDR
- #define SC_PROGLIST_SZ ((MAX_PROGLIST_ENTRIES * sizeof(WORD)) / sizeof(DWORD))+1 //because we used start from 1 but not 0, so pluse one more
- #ifdef TV_GUARDIAN_ENABLE
- // A 4 x 64 Words buffer pool for TV Guardian Data
- #define SC_LINE21_DATA_BUFFER_ADDR (SC_PROGLIST_ADDR + SC_PROGLIST_SZ)
- #define SC_LINE21_DATA_POOL_SIZE 10 //DWORDs
- #define NUM_OF_LINE21DATA_BUFFER_POOL 8
- #define SC_LINE21_DATA_BUFFER_SZ ( NUM_OF_LINE21DATA_BUFFER_POOL * SC_LINE21_DATA_POOL_SIZE ) /*4 by 64words*/
- #else
- #define SC_LINE21_DATA_BUFFER_SZ 0
- #endif //TV_GUARDIAN_ENABLE
- // Menu system use
- #define SC_TMP_MSG_ADDR (SC_PROGLIST_ADDR+SC_PROGLIST_SZ + SC_LINE21_DATA_BUFFER_SZ)
- #define SC_TMP_MSG_SZ 2
- #define SC_TMP_STR_ADDR (SC_TMP_MSG_ADDR+SC_TMP_MSG_SZ)
- #define SC_TMP_STR_SZ 26
- #define SC_PERMANENT_MSG_ADDR (SC_TMP_STR_ADDR + SC_TMP_STR_SZ)
- #define SC_PERMANENT_MSG_SZ 2
- #ifdef S1_GUI
- #define SC_PERMANENT_MSG_LINE_2_ADDR (SC_PERMANENT_MSG_ADDR + SC_PERMANENT_MSG_SZ)
- #define SC_PERMANENT_MSG_LINE_2_SZ 1
- #define SC_CURRENT_TIME_MSG_ADDR (SC_PERMANENT_MSG_LINE_2_ADDR + SC_PERMANENT_MSG_LINE_2_SZ)
- #define SC_CURRENT_TIME_MSG_SZ 6
- #else
- #define SC_MUTE_MSG_ADDR (SC_PERMANENT_MSG_ADDR + SC_PERMANENT_MSG_SZ)
- #define SC_MUTE_MSG_SZ 1
- #define SC_CURRENT_TIME_MSG_ADDR (SC_MUTE_MSG_ADDR + SC_MUTE_MSG_SZ)
- #define SC_CURRENT_TIME_MSG_SZ 6
- #endif
- #define SC_TOTAL_TIME_MSG_ADDR (SC_CURRENT_TIME_MSG_ADDR + SC_CURRENT_TIME_MSG_SZ)
- #define SC_TOTAL_TIME_MSG_SZ 8
- #define SC_ANGLE_MSG_ADDR (SC_TOTAL_TIME_MSG_ADDR + SC_TOTAL_TIME_MSG_SZ)
- #define SC_ANGLE_MSG_SZ 6
- #define SC_TITLE_MSG_ADDR (SC_ANGLE_MSG_ADDR + SC_ANGLE_MSG_SZ)
- #define SC_TITLE_MSG_SZ 6
- #define SC_CHAPTER_MSG_ADDR (SC_TITLE_MSG_ADDR + SC_TITLE_MSG_SZ)
- #define SC_CHAPTER_MSG_SZ 6
- #define SC_TITLE_NUM_MSG_ADDR (SC_CHAPTER_MSG_ADDR + SC_CHAPTER_MSG_SZ)
- #define SC_TITLE_NUM_MSG_SZ 6
- #define SC_CHAPTER_NUM_MSG_ADDR (SC_TITLE_NUM_MSG_ADDR + SC_TITLE_NUM_MSG_SZ)
- #define SC_CHAPTER_NUM_MSG_SZ 6
- #define SC_AUDIO_MSG_ADDR (SC_CHAPTER_MSG_ADDR + SC_CHAPTER_MSG_SZ)
- #define SC_AUDIO_MSG_SZ 20
- #define SC_SUBTITLE_MSG_ADDR (SC_AUDIO_MSG_ADDR + SC_AUDIO_MSG_SZ)
- #define SC_SUBTITLE_MSG_SZ 20
- #define SC_BITRATE_INFO_ADDR (SC_SUBTITLE_MSG_ADDR + SC_SUBTITLE_MSG_SZ)
- #define SC_BITRATE_INFO_SZ 2
- #define SC_BITRATE_MSG_ADDR (SC_BITRATE_INFO_ADDR + SC_BITRATE_INFO_SZ)
- #define SC_BITRATE_MSG_SZ 20
- #define SC_CLIPTYPE_MSG_ADDR (SC_BITRATE_MSG_ADDR + SC_BITRATE_MSG_SZ)
- #define SC_CLIPTYPE_MSG_SZ 10
- #ifdef AVI_DRM_SUPPORT
- #define SC_AVI_DRM_MSG_ADDR (SC_CLIPTYPE_MSG_ADDR + SC_CLIPTYPE_MSG_SZ)
- #define SC_AVI_DRM_MSG_SZ 22
- #endif
- #ifdef AVI_DRM_SUPPORT
- #define SC_VERSION_MSG_ADDR (SC_AVI_DRM_MSG_ADDR + SC_AVI_DRM_MSG_SZ)
- #else
- #define SC_VERSION_MSG_ADDR (SC_CLIPTYPE_MSG_ADDR + SC_CLIPTYPE_MSG_SZ)
- #endif
- #define SC_VERSION_MSG_SZ 20
- #define SC_CURR_CAPTION_BAR_ADDR (SC_VERSION_MSG_ADDR+SC_VERSION_MSG_SZ)
- #ifdef I96_UI_MEM_SAVE
- #define SC_CURR_CAPTION_BAR_SIZE CAPTION_DISPLAY_LEN+4
- #else
- #define SC_CURR_CAPTION_BAR_SIZE 0
- #endif
- #define SC_EXT_INFO_ADDR (SC_CURR_CAPTION_BAR_ADDR+SC_CURR_CAPTION_BAR_SIZE)
- #ifdef I96_UI_MEM_SAVE
- #define SC_EXT_INFO_SIZE EXTINFO_LEN
- #else
- #define SC_EXT_INFO_SIZE 0
- #endif
- //#ifdef DVD_AUDIO_SUPPORT
- #define SC_PAGE_MSG_ADDR (SC_EXT_INFO_ADDR + SC_EXT_INFO_SIZE)
- #define SC_PAGE_MSG_SZ 6
- #define SC_PAGE_NUM_MSG_ADDR (SC_VERSION_MSG_ADDR + SC_VERSION_MSG_SZ)
- #define SC_PAGE_NUM_MSG_SZ 6
- #define SC_DA_AUDIO1_MSG_ADDR (SC_PAGE_MSG_ADDR + SC_PAGE_MSG_SZ)
- #define SC_DA_AUDIO1_MSG_SZ 20
- #define SC_DA_AUDIO2_MSG_ADDR (SC_DA_AUDIO1_MSG_ADDR + SC_DA_AUDIO1_MSG_SZ)
- #define SC_DA_AUDIO2_MSG_SZ 20
- //#endif
- #define SC_VOLUME_ID_ADDR (SC_DA_AUDIO2_MSG_ADDR + SC_DA_AUDIO2_MSG_SZ)
- #define SC_VOLUME_ID_SZ ((FILESYSTEM_MAX_VOLUME_NAME *sizeof(WCHAR)+sizeof(DWORD)-1) / sizeof(DWORD))
- #define SC_CURRENT_PATHNAME_ADDR (SC_VOLUME_ID_ADDR + SC_VOLUME_ID_SZ)
- #define SC_CURRENT_PATHNAME_SZ ((MAX_PATH *sizeof(WCHAR)+sizeof(DWORD)-1)/sizeof(DWORD))
- #define SC_MEMORY_CLUSTERS_REGISTRY_ADDR (SC_CURRENT_PATHNAME_ADDR+SC_CURRENT_PATHNAME_SZ)
- #define SC_MEMORY_CLUSTERS_REGISTRY_SZ ((CLUSTERS_POOL_REG_SZ(SC_CLUSTERS_CNT)+sizeof(DWORD))/sizeof(DWORD))
- #define SC_CLIPS_CURRENT_DIRECTORY_ADDR (SC_MEMORY_CLUSTERS_REGISTRY_ADDR + SC_MEMORY_CLUSTERS_REGISTRY_SZ)
- #define SC_CLIPS_CURRENT_DIRECTORY_SZ (((CLIPS_MAX_DIRNAME_LEN+1)*sizeof(WCHAR)+sizeof(DWORD)-1)/sizeof(DWORD))
- #define SC_CLIPS_CURRENT_FILENAME_ADDR (SC_CLIPS_CURRENT_DIRECTORY_ADDR + SC_CLIPS_CURRENT_DIRECTORY_SZ)
- #define SC_CLIPS_CURRENT_FILENAME_SZ (((CLIPS_MAX_FILENAME_LEN+1)*sizeof(WCHAR)+sizeof(DWORD)-1)/sizeof(DWORD))
- #define SC_MSG_END_ADDR (SC_CLIPS_CURRENT_FILENAME_ADDR + SC_CLIPS_CURRENT_FILENAME_SZ)
- #define SC_AUX_TABLE_ADDR SC_MSG_END_ADDR
- #ifdef SC_AUX_TBL
- #define SC_AUX_TABLE_SZ MAX_CACHED_SECTORS
- #else
- #define SC_AUX_TABLE_SZ 0
- #endif
- #define SC_AUX_END_ADDR SC_AUX_TABLE_ADDR + SC_AUX_TABLE_SZ
- #if D_SUPPORT_SACD //share sc space with DVD.
- #define SC_SACD_TXT_LEN 40 // in word, unicode 8 * 6 = 48, allocate 48 DWORD for 6 song titles within a menu .
- #define SC_SACD_TXT_LEN_IN_DWORD 20 // 8 * 6 = 48, allocate 48 DWORD for 6 song titles within a menu .
- #define SC_SACD_DISC_TITLE SC_SUBTITLE_MSG_ADDR
- #define SC_SACD_TXT_ARTIST (SC_ANGLE_MSG_ADDR + SC_SACD_TXT_LEN_IN_DWORD)
- //#define SC_SACD_TXT_ALBUM (SC_ANGLE_MSG_ADDR + SC_SACD_TXT_LEN_IN_DWORD*2)
- #endif
- #ifdef DVD_VR_SUPPORT// Share the SC space with Global Program-List. when playing DVD VR, it only need 12 program lists
- #define SC_RDI_BUFFER_SZ (CONTAINER_COUNT(RDI_SIZE*MAX_RDI_BUFFER))
- #define SC_RDI_BUFFER_ADDR (SC_PROGLIST_ADDR+SC_PROGLIST_SZ-SC_RDI_BUFFER_SZ)
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // Shared Memory Segments
- //
- // The following are memory-segments inside the Scratch-Pad, which are
- // shared among a number of modules, and their purpose is determined at run
- // time by the module using this space.
- // Navigators Data-Structures for DVD
- #define SC_NAVIGATORS_ADDR (SC_AUX_END_ADDR)
- #ifdef DVD_VR_SUPPORT
- #define SC_DVDVR_NAV_ADDR (SC_NAVIGATORS_ADDR)
- #endif
- // Table-Of-Contents Buffer for CD media
- #define SC_CDTOC_ADDR (SC_AUX_END_ADDR)
- #define SC_CDTOC_SZ (99 * 2) // Needs 2 DWORDs (5 used bytes only) * 99 items
- // Navigator Data-Structures for CD Media
- #define SC_CDDA_NAV_ADDR (SC_CDTOC_ADDR + SC_CDTOC_SZ)
- #define SC_SVCD_NAV_ADDR (SC_CDTOC_ADDR + SC_CDTOC_SZ)
- #define SC_CLIPS_NAV_ADDR (SC_CDTOC_ADDR + SC_CDTOC_SZ)
- #define SC_CLIPS_LIST_ADDRESS (SC_FOR_CLIPS_ADDR>>1)
- #define SC_CLIPS_LIST_SZ (((UINT32)sizeof(Clip)*CLIPS_MAX_PROGRAM_SIZE + 3)>>2) //sizeof(Clip) is 106, mandatory conversion needed
- #define SC_CLIPSDIR1_LIST_ADDRESS (SC_CLIPS_LIST_ADDRESS + SC_CLIPS_LIST_SZ)
- #define SC_CLIPSDIR1_LIST_SZ (((MAX_SUBDIRS_CNT * (1+MAX_DIRNAME_LEN) * 2) + 3)>>2)//now support 150 items with each have 66 characters(each 2 bytes) for 64M SDRAM
- #ifdef MANUAL_DIRECTORY_EXPLORER
- #define SC_CLIPSDIR2_LIST_ADDRESS (SC_CLIPSDIR1_LIST_ADDRESS + SC_CLIPSDIR1_LIST_SZ)
- //#define SC_CLIPSDIR2_LIST_SZ (((MAX_SUBDIRS_CNT * (1+MAX_DIRNAME_LEN) * 2) + 3)>>2)//same size as DIR1
- #endif
- #ifdef DISC_CACHE_ENABLE
- #define SC_DISC_CACHE_TABLE_ADDR SC_CLIPS_LIST_ADDRESS
- #define SC_DISC_CACHE_TABLE_SZ (CACHE_NBR_SLOT*2)
- #define SC_DISC_CACHE_ADDR SC_DISC_CACHE_TABLE_ADDR+SC_DISC_CACHE_TABLE_SZ
- #define SC_DISC_CACHE_SZ (CACHE_NBR_SLOT * 2048UL / BYTE_PER_CONTAINER)
- #endif
- #if D_SUPPORT_SACD
- #define SDRAM_2CH_AREA_INFO_BASE (SC_CLIPSDIR1_LIST_ADDRESS - 0x600ul) //in DWORDS
- #define SDRAM_MULTICH_AREA_INFO_BASE (SC_CLIPSDIR1_LIST_ADDRESS - 0x300ul) //in DWORDS
- #endif
- //card reader todo: check later.
- #ifdef INTERNAL_MEM_CARD_READER //suppose we don't have 5000 clips on a memory card.
- #define SC_MS_TL_PHYSICAL_TABLE_ADDR (FE_BUFFER_START>>1) //2*64bytes for MS physical table. //todo check later.
- //xD type M
- #define SC_MS_TL_TABLE_ADDR (SC_MS_TL_PHYSICAL_TABLE_ADDR + 0x8000ul) //64k * 2 * 2 * 2bytes for MS TL table. //todo check later.
- //xD type M
- #define SC_FILEX_SDRAM_CACHE_ADDR (SC_MS_TL_TABLE_ADDR + 0x20000ul) //8K bytes
- #define SC_FILEX_SDRAM_CACHE_SWITCH_ADDR (SC_FILEX_SDRAM_CACHE_ADDR + 0x2000ul/4) //1/2 k bytes
- #endif
- #endif // __SCPADALLOC_H_