summaryrefslogtreecommitdiff
path: root/libavcodec/ppc/dsputil_ppc.h
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2008-07-20 18:58:30 +0000
committerDiego Biurrun <diego@biurrun.de>2008-07-20 18:58:30 +0000
commite3905ce0afe91ad1422af83334d06d52e4e8fc80 (patch)
tree4b5c16c164776efb5db27f1361bb63df5c2615a4 /libavcodec/ppc/dsputil_ppc.h
parent41f5c62f5cdf17c74d7d3822cfa8db1da734719a (diff)
cosmetics: Reformat PPC code in libavcodec according to style guidelines.
This includes indentation changes, comment reformatting, consistent brace placement and some prettyprinting. Originally committed as revision 14316 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ppc/dsputil_ppc.h')
-rw-r--r--libavcodec/ppc/dsputil_ppc.h135
1 files changed, 66 insertions, 69 deletions
diff --git a/libavcodec/ppc/dsputil_ppc.h b/libavcodec/ppc/dsputil_ppc.h
index d8f6b27f98..1276661b02 100644
--- a/libavcodec/ppc/dsputil_ppc.h
+++ b/libavcodec/ppc/dsputil_ppc.h
@@ -31,40 +31,40 @@ void powerpc_display_perf_report(void);
/* if you add to the enum below, also add to the perfname array
in dsputil_ppc.c */
enum powerpc_perf_index {
- altivec_fft_num = 0,
- altivec_gmc1_num,
- altivec_dct_unquantize_h263_num,
- altivec_fdct,
- altivec_idct_add_num,
- altivec_idct_put_num,
- altivec_put_pixels16_num,
- altivec_avg_pixels16_num,
- altivec_avg_pixels8_num,
- altivec_put_pixels8_xy2_num,
- altivec_put_no_rnd_pixels8_xy2_num,
- altivec_put_pixels16_xy2_num,
- altivec_put_no_rnd_pixels16_xy2_num,
- altivec_hadamard8_diff8x8_num,
- altivec_hadamard8_diff16_num,
- altivec_avg_pixels8_xy2_num,
- powerpc_clear_blocks_dcbz32,
- powerpc_clear_blocks_dcbz128,
- altivec_put_h264_chroma_mc8_num,
- altivec_avg_h264_chroma_mc8_num,
- altivec_put_h264_qpel16_h_lowpass_num,
- altivec_avg_h264_qpel16_h_lowpass_num,
- altivec_put_h264_qpel16_v_lowpass_num,
- altivec_avg_h264_qpel16_v_lowpass_num,
- altivec_put_h264_qpel16_hv_lowpass_num,
- altivec_avg_h264_qpel16_hv_lowpass_num,
- powerpc_perf_total
+ altivec_fft_num = 0,
+ altivec_gmc1_num,
+ altivec_dct_unquantize_h263_num,
+ altivec_fdct,
+ altivec_idct_add_num,
+ altivec_idct_put_num,
+ altivec_put_pixels16_num,
+ altivec_avg_pixels16_num,
+ altivec_avg_pixels8_num,
+ altivec_put_pixels8_xy2_num,
+ altivec_put_no_rnd_pixels8_xy2_num,
+ altivec_put_pixels16_xy2_num,
+ altivec_put_no_rnd_pixels16_xy2_num,
+ altivec_hadamard8_diff8x8_num,
+ altivec_hadamard8_diff16_num,
+ altivec_avg_pixels8_xy2_num,
+ powerpc_clear_blocks_dcbz32,
+ powerpc_clear_blocks_dcbz128,
+ altivec_put_h264_chroma_mc8_num,
+ altivec_avg_h264_chroma_mc8_num,
+ altivec_put_h264_qpel16_h_lowpass_num,
+ altivec_avg_h264_qpel16_h_lowpass_num,
+ altivec_put_h264_qpel16_v_lowpass_num,
+ altivec_avg_h264_qpel16_v_lowpass_num,
+ altivec_put_h264_qpel16_hv_lowpass_num,
+ altivec_avg_h264_qpel16_hv_lowpass_num,
+ powerpc_perf_total
};
enum powerpc_data_index {
- powerpc_data_min = 0,
- powerpc_data_max,
- powerpc_data_sum,
- powerpc_data_num,
- powerpc_data_total
+ powerpc_data_min = 0,
+ powerpc_data_max,
+ powerpc_data_sum,
+ powerpc_data_num,
+ powerpc_data_total
};
extern unsigned long long perfdata[POWERPC_NUM_PMC_ENABLED][powerpc_perf_total][powerpc_data_total];
@@ -105,45 +105,42 @@ extern unsigned long long perfdata[POWERPC_NUM_PMC_ENABLED][powerpc_perf_total][
#define POWERPC_GET_PMC6(a) do {} while (0)
#endif
#endif /* HAVE_PPC64 */
-#define POWERPC_PERF_DECLARE(a, cond) \
- POWERP_PMC_DATATYPE \
- pmc_start[POWERPC_NUM_PMC_ENABLED], \
- pmc_stop[POWERPC_NUM_PMC_ENABLED], \
- pmc_loop_index;
+#define POWERPC_PERF_DECLARE(a, cond) \
+ POWERP_PMC_DATATYPE \
+ pmc_start[POWERPC_NUM_PMC_ENABLED], \
+ pmc_stop[POWERPC_NUM_PMC_ENABLED], \
+ pmc_loop_index;
#define POWERPC_PERF_START_COUNT(a, cond) do { \
- POWERPC_GET_PMC6(pmc_start[5]); \
- POWERPC_GET_PMC5(pmc_start[4]); \
- POWERPC_GET_PMC4(pmc_start[3]); \
- POWERPC_GET_PMC3(pmc_start[2]); \
- POWERPC_GET_PMC2(pmc_start[1]); \
- POWERPC_GET_PMC1(pmc_start[0]); \
- } while (0)
+ POWERPC_GET_PMC6(pmc_start[5]); \
+ POWERPC_GET_PMC5(pmc_start[4]); \
+ POWERPC_GET_PMC4(pmc_start[3]); \
+ POWERPC_GET_PMC3(pmc_start[2]); \
+ POWERPC_GET_PMC2(pmc_start[1]); \
+ POWERPC_GET_PMC1(pmc_start[0]); \
+ } while (0)
#define POWERPC_PERF_STOP_COUNT(a, cond) do { \
- POWERPC_GET_PMC1(pmc_stop[0]); \
- POWERPC_GET_PMC2(pmc_stop[1]); \
- POWERPC_GET_PMC3(pmc_stop[2]); \
- POWERPC_GET_PMC4(pmc_stop[3]); \
- POWERPC_GET_PMC5(pmc_stop[4]); \
- POWERPC_GET_PMC6(pmc_stop[5]); \
- if (cond) \
- { \
- for(pmc_loop_index = 0; \
- pmc_loop_index < POWERPC_NUM_PMC_ENABLED; \
- pmc_loop_index++) \
- { \
- if (pmc_stop[pmc_loop_index] >= pmc_start[pmc_loop_index]) \
- { \
- POWERP_PMC_DATATYPE diff = \
- pmc_stop[pmc_loop_index] - pmc_start[pmc_loop_index]; \
- if (diff < perfdata[pmc_loop_index][a][powerpc_data_min]) \
- perfdata[pmc_loop_index][a][powerpc_data_min] = diff; \
- if (diff > perfdata[pmc_loop_index][a][powerpc_data_max]) \
- perfdata[pmc_loop_index][a][powerpc_data_max] = diff; \
- perfdata[pmc_loop_index][a][powerpc_data_sum] += diff; \
- perfdata[pmc_loop_index][a][powerpc_data_num] ++; \
- } \
- } \
- } \
+ POWERPC_GET_PMC1(pmc_stop[0]); \
+ POWERPC_GET_PMC2(pmc_stop[1]); \
+ POWERPC_GET_PMC3(pmc_stop[2]); \
+ POWERPC_GET_PMC4(pmc_stop[3]); \
+ POWERPC_GET_PMC5(pmc_stop[4]); \
+ POWERPC_GET_PMC6(pmc_stop[5]); \
+ if (cond) { \
+ for(pmc_loop_index = 0; \
+ pmc_loop_index < POWERPC_NUM_PMC_ENABLED; \
+ pmc_loop_index++) { \
+ if (pmc_stop[pmc_loop_index] >= pmc_start[pmc_loop_index]) { \
+ POWERP_PMC_DATATYPE diff = \
+ pmc_stop[pmc_loop_index] - pmc_start[pmc_loop_index]; \
+ if (diff < perfdata[pmc_loop_index][a][powerpc_data_min]) \
+ perfdata[pmc_loop_index][a][powerpc_data_min] = diff; \
+ if (diff > perfdata[pmc_loop_index][a][powerpc_data_max]) \
+ perfdata[pmc_loop_index][a][powerpc_data_max] = diff; \
+ perfdata[pmc_loop_index][a][powerpc_data_sum] += diff; \
+ perfdata[pmc_loop_index][a][powerpc_data_num] ++; \
+ } \
+ } \
+ } \
} while (0)
#else /* CONFIG_POWERPC_PERF */
// those are needed to avoid empty statements.