aboutsummaryrefslogtreecommitdiff
path: root/encoder/svc/isvce_defs.h
blob: c277abd2554c0a158f89d79ebb64af529a53eec1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
/******************************************************************************
 *
 * Copyright (C) 2022 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at:
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 *****************************************************************************
 * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
 */
/**
*******************************************************************************
* @file
*  isvce_defs.h
*
* @brief
*  Definitions used in the encoder
*
* @author
*  ittiam
*
* @remarks
*  None
*
*******************************************************************************
*/

#ifndef _ISVCE_DEFS_H_
#define _ISVCE_DEFS_H_

#include "ih264e_defs.h"

#define SVC_MAX_NUM_BFRAMES 0

#define DEFAULT_INIT_QP 1

#define SVC_MAX_NUM_INP_FRAMES ((SVC_MAX_NUM_BFRAMES) + 2)

#define LOG2_MAX_FRAME_NUM_MINUS4 12

#define ENC_MAX_PU_IN_MB ((MB_SIZE / ENC_MIN_PU_SIZE) * (MB_SIZE / ENC_MIN_PU_SIZE))

#define MAX_REF_FRAMES_PER_PRED_DIR 1

#define SVC_MAX_SLICE_HDR_CNT 1

#define MAX_LAYER_REFERENCE_PICS 1

#define ENABLE_RESIDUAL_PREDICTION 1

#define ENABLE_ILP_MV 1

#define USE_ILP_MV_IN_ME (1 && (ENABLE_ILP_MV))

#define USE_ILP_MV_AS_MVP (1 && (ENABLE_ILP_MV))

#define MAX_MVP_IDX (USE_ILP_MV_AS_MVP ? 1 : 0)

#define ENABLE_IBL_MODE 1

#define ENABLE_INTRA_BASE_DEBLOCK (0 && (ENABLE_IBL_MODE))

#define ENABLE_MODE_STAT_VISUALISER 0

#define FORCE_FAST_INTRA4X4 0

#define FORCE_DISTORTION_BASED_INTRA_4X4_GATING 1

#define ENABLE_INTRA16X16_BASED_INTRA4X4_GATING 0

#define ENABLE_ILP_BASED_INTRA4X4_GATING 0

#define DISABLE_POST_ENC_SKIP 1

#define ENABLE_RE_ENC_AS_SKIP 1

#define MAX_ILP_MV_IN_NBR_RGN 4

/* L, T, TL, TR, Zero, Skip, 'Temporal Skip', ILP */
#define MAX_FPEL_SEARCH_CANDIDATES (7 + MAX_PU_IN_MB + MAX_ILP_MV_IN_NBR_RGN)

#define NUM_SVCE_RC_MEMTABS 45

#define SVCE_MAX_INP_DIM 1920

#define SVCE_MAX_INP_FRAME_SIZE (1920 * 1088)

/**
 ***************************************************************************
 * Enum to hold various mem records being request
 ****************************************************************************
 */
typedef enum ISVCE_MEMREC_TYPES_T
{
    /**
     * Codec Object at API level
     */
    ISVCE_MEM_REC_IV_OBJ,

    /**
     * Codec context
     */
    ISVCE_MEM_REC_CODEC,

    /**
     * Cabac context
     */
    ISVCE_MEM_REC_CABAC,

    /**
     * Cabac context_mb_info
     */
    ISVCE_MEM_REC_CABAC_MB_INFO,

    /**
     * entropy context
     */
    ISVCE_MEM_REC_ENTROPY,

    /**
     * Buffer to hold coeff data
     */
    ISVCE_MEM_REC_MB_COEFF_DATA,

    /**
     * Buffer to hold coeff data
     */
    ISVCE_MEM_REC_MB_HEADER_DATA,

    /**
     * Motion vector bank
     */
    ISVCE_MEM_REC_MVBANK,

    /**
     * Motion vector bits
     */
    ISVCE_MEM_REC_MVBITS,

    /**
     * Holds mem records passed to the codec.
     */
    ISVCE_MEM_REC_BACKUP,

    /**
     * Holds SPS
     */
    ISVCE_MEM_REC_SPS,

    /**
     * Holds PPS
     */
    ISVCE_MEM_REC_PPS,

    /**
     * Holds SVC NALU Extension data
     */
    ISVCE_MEM_REC_SVC_NALU_EXT,

    /**
     * Holds subset SPS data
     */
    ISVCE_MEM_REC_SUBSET_SPS,

    /**
     * Holds Slice Headers
     */
    ISVCE_MEM_REC_SLICE_HDR,

    /**
     * Holds SVC Slice Headers
     */
    ISVCE_MEM_REC_SVC_SLICE_HDR,

    /**
     * Contains map indicating slice index per MB basis
     */
    ISVCE_MEM_REC_SLICE_MAP,

    /**
     * Holds thread handles
     */
    ISVCE_MEM_REC_THREAD_HANDLE,

    /**
     * Holds control call mutex
     */
    ISVCE_MEM_REC_CTL_MUTEX,

    /**
     * Holds entropy call mutex
     */
    ISVCE_MEM_REC_ENTROPY_MUTEX,

    /**
     * Holds memory for Process JOB Queue
     */
    ISVCE_MEM_REC_PROC_JOBQ,

    /**
     * Holds memory for Entropy JOB Queue
     */
    ISVCE_MEM_REC_ENTROPY_JOBQ,

    /**
     * Contains status map indicating processing status per MB basis
     */
    ISVCE_MEM_REC_PROC_MAP,

    /**
     * Contains status map indicating deblocking status per MB basis
     */
    ISVCE_MEM_REC_DBLK_MAP,

    /*
     * Contains AIR map and mask
     */
    ISVCE_MEM_REC_AIR_MAP,

    /**
     * Contains status map indicating ME status per MB basis
     */
    ISVCE_MEM_REC_ME_MAP,

    /**
     * Holds dpb manager context
     */
    ISVCE_MEM_REC_DPB_MGR,

    /**
     * Holds intermediate buffers needed during processing stage
     * Memory for process contexts is allocated in this memtab
     */
    ISVCE_MEM_REC_PROC_SCRATCH,

    /**
     * Holds buffers for vert_bs, horz_bs and QP (all frame level)
     */
    ISVCE_MEM_REC_QUANT_PARAM,

    /**
     * Holds top row syntax information
     */
    ISVCE_MEM_REC_TOP_ROW_SYN_INFO,

    /**
     * Holds buffers for vert_bs, horz_bs and QP (all frame level)
     */
    ISVCE_MEM_REC_BS_QP,

    /**
     * Holds input buffer manager context
     */
    ISVCE_MEM_REC_INP_PIC,

    /**
     * Holds output buffer manager context
     */
    ISVCE_MEM_REC_OUT,

    /**
     * Holds picture buffer manager context and array of pic_buf_ts
     * Also holds reference picture buffers in non-shared mode
     */
    ISVCE_MEM_REC_REF_PIC,

    /*
     * Mem record for color space conversion
     */
    ISVCE_MEM_REC_CSC,

    /**
     * NMB info struct
     */
    ISVCE_MEM_REC_MB_INFO_NMB,

    /**
     * SVC Spatial layer Inputs
     */
    ISVCE_MEM_SVC_SPAT_INP,

    /**
     * Downscaler memory records
     */
    ISVCE_MEM_DOWN_SCALER,

    /**
     * SVC ILP data
     */
    ISVCE_MEM_SVC_ILP_DATA,

    /**
     * SVC ILP MV Context
     */
    ISVCE_MEM_SVC_ILP_MV_CTXT,

    /**
     * SVC ResPred Context
     */
    ISVCE_MEM_SVC_RES_PRED_CTXT,

    /**
     * SVC inter-layer intra pred context
     */
    ISVCE_MEM_SVC_INTRA_PRED_CTXT,

    /**
     * RC Utils Context
     */
    ISVCE_MEM_SVC_RC_UTILS_CTXT,

    /**
     * SubPic RC Context
     */
    ISVCE_MEM_SVC_SUB_PIC_RC_CTXT,

#if ENABLE_MODE_STAT_VISUALISER
    ISVCE_MEM_MODE_STAT_VISUALISER_BUF,
#endif

    /**
     * Rate control of memory records.
     */
    ISVCE_MEM_REC_RC,

    /**
     * Place holder to compute number of memory records.
     */
    ISVCE_MEM_REC_CNT = ISVCE_MEM_REC_RC + NUM_SVCE_RC_MEMTABS,

    /*
     * Do not add anything below
     */
} ISVCE_MEMREC_TYPES_T;

#endif