Skip to content
This repository was archived by the owner on Jan 31, 2025. It is now read-only.

Commit 85d5aa7

Browse files
committed
Unify the coding style in the driver
Linux coding style is used in the driver source code. Use the command below to format/indent .c/.h files $> astyle --style=linux -cnpUH -s4 -M120 <file> A script of style_unify is added in the top-level directory to handle all .c/.h files in the driver. There is no change to any functionality This fixes #99 Signed-off-by: Xiang, Haihao <[email protected]>
1 parent 38a124e commit 85d5aa7

File tree

105 files changed

+44191
-45241
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+44191
-45241
lines changed

src/dso_utils.c

+4-5
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
* distribute, sub license, and/or sell copies of the Software, and to
99
* permit persons to whom the Software is furnished to do so, subject to
1010
* the following conditions:
11-
*
11+
*
1212
* The above copyright notice and this permission notice (including the
1313
* next paragraph) shall be included in all copies or substantial portions
1414
* of the Software.
15-
*
15+
*
1616
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1717
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1818
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
@@ -43,11 +43,10 @@ dso_open(const char *path)
4343
return NULL;
4444

4545
if (path) {
46-
h->handle = dlopen(path, RTLD_LAZY|RTLD_LOCAL);
46+
h->handle = dlopen(path, RTLD_LAZY | RTLD_LOCAL);
4747
if (!h->handle)
4848
goto error;
49-
}
50-
else
49+
} else
5150
h->handle = RTLD_DEFAULT;
5251
return h;
5352

src/dso_utils.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
* distribute, sub license, and/or sell copies of the Software, and to
99
* permit persons to whom the Software is furnished to do so, subject to
1010
* the following conditions:
11-
*
11+
*
1212
* The above copyright notice and this permission notice (including the
1313
* next paragraph) shall be included in all copies or substantial portions
1414
* of the Software.
15-
*
15+
*
1616
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1717
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1818
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.

src/gen6_mfc.c

+157-158
Large diffs are not rendered by default.

src/gen6_mfc.h

+47-54
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ struct encode_state;
4545

4646
/* The space required for slice header SLICE_STATE + header.
4747
* Is it enough? */
48-
#define SLICE_HEADER 80
48+
#define SLICE_HEADER 80
4949

5050
/* the space required for slice tail. */
51-
#define SLICE_TAIL 16
51+
#define SLICE_TAIL 16
5252

5353

5454
#define MFC_BATCHBUFFER_AVC_INTRA 0
@@ -81,25 +81,24 @@ struct encode_state;
8181
#define BRC_PI_0_5 1.5707963267948966192313216916398
8282

8383
typedef enum {
84-
VME_V_PRED = 0,
85-
VME_H_PRED = 1,
86-
VME_DC_PRED = 2,
87-
VME_PL_PRED = 3,
84+
VME_V_PRED = 0,
85+
VME_H_PRED = 1,
86+
VME_DC_PRED = 2,
87+
VME_PL_PRED = 3,
8888

89-
VME_MB_INTRA_MODE_COUNT
89+
VME_MB_INTRA_MODE_COUNT
9090
} VME_MB_INTRA_PRED_MODE;
9191

9292
typedef enum {
93-
PAK_DC_PRED = 0,
94-
PAK_V_PRED = 1,
95-
PAK_H_PRED = 2,
96-
PAK_TM_PRED = 3,
93+
PAK_DC_PRED = 0,
94+
PAK_V_PRED = 1,
95+
PAK_H_PRED = 2,
96+
PAK_TM_PRED = 3,
9797

98-
PAK_MB_INTRA_MODE_COUNT
98+
PAK_MB_INTRA_MODE_COUNT
9999
} VP8_PAK_MB_INTRA_PRED_MODE;
100100

101-
typedef enum
102-
{
101+
typedef enum {
103102
VME_B_V_PRED = 0,
104103
VME_B_H_PRED = 1,
105104
VME_B_DC_PRED = 2,
@@ -113,8 +112,7 @@ typedef enum
113112
VME_B_INTRA_MODE_COUNT
114113
} VME_BLOCK_INTRA_PRED_MODE;
115114

116-
typedef enum
117-
{
115+
typedef enum {
118116
PAK_B_DC_PRED = 0,
119117
PAK_B_TM_PRED = 1,
120118
PAK_B_VE_PRED = 2,
@@ -129,35 +127,30 @@ typedef enum
129127
PAK_B_INTRA_MODE_COUNT
130128
} VP8_PAK_BLOCK_INTRA_PRED_MODE;
131129

132-
typedef struct
133-
{
134-
int vme_intra_mb_mode;
135-
int vp8_pak_intra_mb_mode;
130+
typedef struct {
131+
int vme_intra_mb_mode;
132+
int vp8_pak_intra_mb_mode;
136133
} vp8_intra_mb_mode_map_t;
137134

138-
typedef struct
139-
{
140-
int vme_intra_block_mode;
141-
int vp8_pak_intra_block_mode;
135+
typedef struct {
136+
int vme_intra_block_mode;
137+
int vp8_pak_intra_block_mode;
142138
} vp8_intra_block_mode_map_t;
143139

144-
typedef enum _gen6_brc_status
145-
{
140+
typedef enum _gen6_brc_status {
146141
BRC_NO_HRD_VIOLATION = 0,
147142
BRC_UNDERFLOW = 1,
148143
BRC_OVERFLOW = 2,
149144
BRC_UNDERFLOW_WITH_MAX_QP = 3,
150145
BRC_OVERFLOW_WITH_MIN_QP = 4,
151146
} gen6_brc_status;
152147

153-
struct gen6_mfc_avc_surface_aux
154-
{
148+
struct gen6_mfc_avc_surface_aux {
155149
dri_bo *dmv_top;
156150
dri_bo *dmv_bottom;
157151
};
158152

159-
struct gen6_mfc_context
160-
{
153+
struct gen6_mfc_context {
161154
struct {
162155
unsigned int width;
163156
unsigned int height;
@@ -167,49 +160,49 @@ struct gen6_mfc_context
167160

168161
//MFX_PIPE_BUF_ADDR_STATE
169162
struct {
170-
dri_bo *bo;
171-
} post_deblocking_output; //OUTPUT: reconstructed picture
172-
173-
struct {
174-
dri_bo *bo;
175-
} pre_deblocking_output; //OUTPUT: reconstructed picture with deblocked
163+
dri_bo *bo;
164+
} post_deblocking_output; //OUTPUT: reconstructed picture
165+
166+
struct {
167+
dri_bo *bo;
168+
} pre_deblocking_output; //OUTPUT: reconstructed picture with deblocked
176169

177170
struct {
178171
dri_bo *bo;
179172
} uncompressed_picture_source; //INPUT: original compressed image
180173

181174
struct {
182-
dri_bo *bo;
175+
dri_bo *bo;
183176
} intra_row_store_scratch_buffer; //INTERNAL:
184177

185178
struct {
186179
dri_bo *bo;
187180
} macroblock_status_buffer; //INTERNAL:
188181

189182
struct {
190-
dri_bo *bo;
183+
dri_bo *bo;
191184
} deblocking_filter_row_store_scratch_buffer; //INTERNAL:
192185

193-
struct {
194-
dri_bo *bo;
186+
struct {
187+
dri_bo *bo;
195188
} reference_surfaces[MAX_MFC_REFERENCE_SURFACES]; //INTERNAL: refrence surfaces
196189

197190
//MFX_IND_OBJ_BASE_ADDR_STATE
198-
struct{
191+
struct {
199192
dri_bo *bo;
200193
} mfc_indirect_mv_object; //INPUT: the blocks' mv info
201194

202195
struct {
203196
dri_bo *bo;
204197
int offset;
205198
int end_offset;
206-
} mfc_indirect_pak_bse_object; //OUTPUT: the compressed bitstream
199+
} mfc_indirect_pak_bse_object; //OUTPUT: the compressed bitstream
207200

208201
//MFX_BSP_BUF_BASE_ADDR_STATE
209202
struct {
210203
dri_bo *bo;
211204
} bsd_mpc_row_store_scratch_buffer; //INTERNAL:
212-
205+
213206
//MFX_AVC_DIRECTMODE_STATE
214207
struct {
215208
dri_bo *bo;
@@ -223,7 +216,7 @@ struct gen6_mfc_context
223216
unsigned char GrowInit;
224217
unsigned char GrowResistance;
225218
unsigned char ShrinkInit;
226-
unsigned char ShrinkResistance;
219+
unsigned char ShrinkResistance;
227220
} bit_rate_control_context[3]; //INTERNAL: for I, P, B frames
228221

229222
struct {
@@ -257,8 +250,8 @@ struct gen6_mfc_context
257250
int i_initial_cpb_removal_delay_length;
258251
int i_cpb_removal_delay_length;
259252
int i_dpb_output_delay_length;
260-
}vui_hrd;
261-
253+
} vui_hrd;
254+
262255
struct {
263256
unsigned char *vp8_frame_header;
264257
unsigned int frame_header_bit_count;
@@ -280,15 +273,15 @@ struct gen6_mfc_context
280273
unsigned char prob_intra;
281274
unsigned char prob_last;
282275
unsigned char prob_gf;
283-
276+
284277
dri_bo *frame_header_bo;
285278
dri_bo *intermediate_bo;
286279
dri_bo *final_frame_bo;
287280
dri_bo *stream_out_bo;
288281
dri_bo *coeff_probs_stream_in_bo;
289282
dri_bo *token_statistics_bo;
290283
dri_bo *mpc_row_store_bo;
291-
}vp8_state;
284+
} vp8_state;
292285

293286
//"buffered_QMatrix" will be used to buffer the QMatrix if the app sends one.
294287
// Or else, we will load a default QMatrix from the driver for JPEG encode.
@@ -368,7 +361,7 @@ extern void intel_mfc_avc_pipeline_header_programing(VADriverContextP ctx,
368361
struct intel_encoder_context *encoder_context,
369362
struct intel_batchbuffer *slice_batch);
370363

371-
extern VAStatus intel_mfc_avc_prepare(VADriverContextP ctx,
364+
extern VAStatus intel_mfc_avc_prepare(VADriverContextP ctx,
372365
struct encode_state *encode_state,
373366
struct intel_encoder_context *encoder_context);
374367

@@ -384,12 +377,12 @@ Bool gen8_mfc_context_init(VADriverContextP ctx, struct intel_encoder_context *e
384377

385378
extern void
386379
intel_avc_slice_insert_packed_data(VADriverContextP ctx,
387-
struct encode_state *encode_state,
388-
struct intel_encoder_context *encoder_context,
389-
int slice_index,
390-
struct intel_batchbuffer *slice_batch);
380+
struct encode_state *encode_state,
381+
struct intel_encoder_context *encoder_context,
382+
int slice_index,
383+
struct intel_batchbuffer *slice_batch);
391384

392385
extern
393386
Bool gen9_mfc_context_init(VADriverContextP ctx, struct intel_encoder_context *encoder_context);
394387

395-
#endif /* _GEN6_MFC_BCS_H_ */
388+
#endif /* _GEN6_MFC_BCS_H_ */

0 commit comments

Comments
 (0)