00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include <stdint.h>
00022
00023 #include "libavutil/arm/cpu.h"
00024 #include "libavcodec/dsputil.h"
00025 #include "libavcodec/h264dsp.h"
00026
00027 void ff_h264_v_loop_filter_luma_neon(uint8_t *pix, int stride, int alpha,
00028 int beta, int8_t *tc0);
00029 void ff_h264_h_loop_filter_luma_neon(uint8_t *pix, int stride, int alpha,
00030 int beta, int8_t *tc0);
00031 void ff_h264_v_loop_filter_chroma_neon(uint8_t *pix, int stride, int alpha,
00032 int beta, int8_t *tc0);
00033 void ff_h264_h_loop_filter_chroma_neon(uint8_t *pix, int stride, int alpha,
00034 int beta, int8_t *tc0);
00035
00036 void ff_weight_h264_pixels_16_neon(uint8_t *dst, int stride, int height,
00037 int log2_den, int weight, int offset);
00038 void ff_weight_h264_pixels_8_neon(uint8_t *dst, int stride, int height,
00039 int log2_den, int weight, int offset);
00040 void ff_weight_h264_pixels_4_neon(uint8_t *dst, int stride, int height,
00041 int log2_den, int weight, int offset);
00042
00043 void ff_biweight_h264_pixels_16_neon(uint8_t *dst, uint8_t *src, int stride,
00044 int height, int log2_den, int weightd,
00045 int weights, int offset);
00046 void ff_biweight_h264_pixels_8_neon(uint8_t *dst, uint8_t *src, int stride,
00047 int height, int log2_den, int weightd,
00048 int weights, int offset);
00049 void ff_biweight_h264_pixels_4_neon(uint8_t *dst, uint8_t *src, int stride,
00050 int height, int log2_den, int weightd,
00051 int weights, int offset);
00052
00053 void ff_h264_idct_add_neon(uint8_t *dst, DCTELEM *block, int stride);
00054 void ff_h264_idct_dc_add_neon(uint8_t *dst, DCTELEM *block, int stride);
00055 void ff_h264_idct_add16_neon(uint8_t *dst, const int *block_offset,
00056 DCTELEM *block, int stride,
00057 const uint8_t nnzc[6*8]);
00058 void ff_h264_idct_add16intra_neon(uint8_t *dst, const int *block_offset,
00059 DCTELEM *block, int stride,
00060 const uint8_t nnzc[6*8]);
00061 void ff_h264_idct_add8_neon(uint8_t **dest, const int *block_offset,
00062 DCTELEM *block, int stride,
00063 const uint8_t nnzc[6*8]);
00064
00065 void ff_h264_idct8_add_neon(uint8_t *dst, DCTELEM *block, int stride);
00066 void ff_h264_idct8_dc_add_neon(uint8_t *dst, DCTELEM *block, int stride);
00067 void ff_h264_idct8_add4_neon(uint8_t *dst, const int *block_offset,
00068 DCTELEM *block, int stride,
00069 const uint8_t nnzc[6*8]);
00070
00071 static void ff_h264dsp_init_neon(H264DSPContext *c, const int bit_depth, const int chroma_format_idc)
00072 {
00073 #if HAVE_NEON
00074 if (bit_depth == 8) {
00075 c->h264_v_loop_filter_luma = ff_h264_v_loop_filter_luma_neon;
00076 c->h264_h_loop_filter_luma = ff_h264_h_loop_filter_luma_neon;
00077 if(chroma_format_idc == 1){
00078 c->h264_v_loop_filter_chroma = ff_h264_v_loop_filter_chroma_neon;
00079 c->h264_h_loop_filter_chroma = ff_h264_h_loop_filter_chroma_neon;
00080 }
00081
00082 c->weight_h264_pixels_tab[0] = ff_weight_h264_pixels_16_neon;
00083 c->weight_h264_pixels_tab[1] = ff_weight_h264_pixels_8_neon;
00084 c->weight_h264_pixels_tab[2] = ff_weight_h264_pixels_4_neon;
00085
00086 c->biweight_h264_pixels_tab[0] = ff_biweight_h264_pixels_16_neon;
00087 c->biweight_h264_pixels_tab[1] = ff_biweight_h264_pixels_8_neon;
00088 c->biweight_h264_pixels_tab[2] = ff_biweight_h264_pixels_4_neon;
00089
00090 c->h264_idct_add = ff_h264_idct_add_neon;
00091 c->h264_idct_dc_add = ff_h264_idct_dc_add_neon;
00092 c->h264_idct_add16 = ff_h264_idct_add16_neon;
00093 c->h264_idct_add16intra = ff_h264_idct_add16intra_neon;
00094 if (chroma_format_idc == 1)
00095 c->h264_idct_add8 = ff_h264_idct_add8_neon;
00096 c->h264_idct8_add = ff_h264_idct8_add_neon;
00097 c->h264_idct8_dc_add = ff_h264_idct8_dc_add_neon;
00098 c->h264_idct8_add4 = ff_h264_idct8_add4_neon;
00099 }
00100 #endif // HAVE_NEON
00101 }
00102
00103 void ff_h264dsp_init_arm(H264DSPContext *c, const int bit_depth, const int chroma_format_idc)
00104 {
00105 int cpu_flags = av_get_cpu_flags();
00106
00107 if (have_neon(cpu_flags))
00108 ff_h264dsp_init_neon(c, bit_depth, chroma_format_idc);
00109 }