1 | |
---|
2 | |
---|
3 | /** \file ContextModel3DBuffer.h |
---|
4 | \brief context model 3D buffer class (header) |
---|
5 | */ |
---|
6 | |
---|
7 | #ifndef __CONTEXT_MODEL_3DBUFFER__ |
---|
8 | #define __CONTEXT_MODEL_3DBUFFER__ |
---|
9 | |
---|
10 | #if _MSC_VER > 1000 |
---|
11 | #pragma once |
---|
12 | #endif // _MSC_VER > 1000 |
---|
13 | |
---|
14 | #include <stdio.h> |
---|
15 | #include <assert.h> |
---|
16 | #include <memory.h> |
---|
17 | |
---|
18 | #include "CommonDef.h" |
---|
19 | #include "ContextModel.h" |
---|
20 | |
---|
21 | // ==================================================================================================================== |
---|
22 | // Class definition |
---|
23 | // ==================================================================================================================== |
---|
24 | |
---|
25 | /// context model 3D buffer class |
---|
26 | class ContextModel3DBuffer |
---|
27 | { |
---|
28 | protected: |
---|
29 | ContextModel* m_pcContextModel; ///< array of context models |
---|
30 | const UInt m_uiSizeX; ///< X size of 3D buffer |
---|
31 | const UInt m_uiSizeY; ///< Y size of 3D buffer |
---|
32 | const UInt m_uiSizeZ; ///< Z size of 3D buffer |
---|
33 | |
---|
34 | public: |
---|
35 | ContextModel3DBuffer ( UInt uiSizeZ, UInt uiSizeY, UInt uiSizeX ); |
---|
36 | ~ContextModel3DBuffer (); |
---|
37 | |
---|
38 | // access functions |
---|
39 | ContextModel& get( UInt uiZ, UInt uiY, UInt uiX ) |
---|
40 | { |
---|
41 | return m_pcContextModel[ ( uiZ * m_uiSizeY + uiY ) * m_uiSizeX + uiX ]; |
---|
42 | } |
---|
43 | ContextModel* get( UInt uiZ, UInt uiY ) |
---|
44 | { |
---|
45 | return &m_pcContextModel[ ( uiZ * m_uiSizeY + uiY ) * m_uiSizeX ]; |
---|
46 | } |
---|
47 | ContextModel* get( UInt uiZ ) |
---|
48 | { |
---|
49 | return &m_pcContextModel[ ( uiZ * m_uiSizeY ) * m_uiSizeX ]; |
---|
50 | } |
---|
51 | |
---|
52 | // initialization & copy functions |
---|
53 | Void initBuffer( SliceType eSliceType, Int iQp, Short* psCtxModel ); ///< initialize 3D buffer by slice type & QP |
---|
54 | Void copyFrom ( ContextModel3DBuffer* pSrc ); ///< copy from given 3D buffer |
---|
55 | }; |
---|
56 | |
---|
57 | #endif |
---|
58 | |
---|