Libav 0.7.1
|
00001 /* 00002 * Copyright (c) 2010 Mans Rullgard <mans@mansr.com> 00003 * 00004 * This file is part of Libav. 00005 * 00006 * Libav is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Lesser General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2.1 of the License, or (at your option) any later version. 00010 * 00011 * Libav is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Lesser General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Lesser General Public 00017 * License along with Libav; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00019 */ 00020 00021 #include <stdint.h> 00022 00023 #include "libavcodec/dsputil.h" 00024 #include "libavcodec/h264dsp.h" 00025 00026 void ff_h264_v_loop_filter_luma_neon(uint8_t *pix, int stride, int alpha, 00027 int beta, int8_t *tc0); 00028 void ff_h264_h_loop_filter_luma_neon(uint8_t *pix, int stride, int alpha, 00029 int beta, int8_t *tc0); 00030 void ff_h264_v_loop_filter_chroma_neon(uint8_t *pix, int stride, int alpha, 00031 int beta, int8_t *tc0); 00032 void ff_h264_h_loop_filter_chroma_neon(uint8_t *pix, int stride, int alpha, 00033 int beta, int8_t *tc0); 00034 00035 void ff_weight_h264_pixels_16x16_neon(uint8_t *ds, int stride, int log2_den, 00036 int weight, int offset); 00037 void ff_weight_h264_pixels_16x8_neon(uint8_t *ds, int stride, int log2_den, 00038 int weight, int offset); 00039 void ff_weight_h264_pixels_8x16_neon(uint8_t *ds, int stride, int log2_den, 00040 int weight, int offset); 00041 void ff_weight_h264_pixels_8x8_neon(uint8_t *ds, int stride, int log2_den, 00042 int weight, int offset); 00043 void ff_weight_h264_pixels_8x4_neon(uint8_t *ds, int stride, int log2_den, 00044 int weight, int offset); 00045 void ff_weight_h264_pixels_4x8_neon(uint8_t *ds, int stride, int log2_den, 00046 int weight, int offset); 00047 void ff_weight_h264_pixels_4x4_neon(uint8_t *ds, int stride, int log2_den, 00048 int weight, int offset); 00049 void ff_weight_h264_pixels_4x2_neon(uint8_t *ds, int stride, int log2_den, 00050 int weight, int offset); 00051 00052 void ff_biweight_h264_pixels_16x16_neon(uint8_t *dst, uint8_t *src, int stride, 00053 int log2_den, int weightd, int weights, 00054 int offset); 00055 void ff_biweight_h264_pixels_16x8_neon(uint8_t *dst, uint8_t *src, int stride, 00056 int log2_den, int weightd, int weights, 00057 int offset); 00058 void ff_biweight_h264_pixels_8x16_neon(uint8_t *dst, uint8_t *src, int stride, 00059 int log2_den, int weightd, int weights, 00060 int offset); 00061 void ff_biweight_h264_pixels_8x8_neon(uint8_t *dst, uint8_t *src, int stride, 00062 int log2_den, int weightd, int weights, 00063 int offset); 00064 void ff_biweight_h264_pixels_8x4_neon(uint8_t *dst, uint8_t *src, int stride, 00065 int log2_den, int weightd, int weights, 00066 int offset); 00067 void ff_biweight_h264_pixels_4x8_neon(uint8_t *dst, uint8_t *src, int stride, 00068 int log2_den, int weightd, int weights, 00069 int offset); 00070 void ff_biweight_h264_pixels_4x4_neon(uint8_t *dst, uint8_t *src, int stride, 00071 int log2_den, int weightd, int weights, 00072 int offset); 00073 void ff_biweight_h264_pixels_4x2_neon(uint8_t *dst, uint8_t *src, int stride, 00074 int log2_den, int weightd, int weights, 00075 int offset); 00076 00077 void ff_h264_idct_add_neon(uint8_t *dst, DCTELEM *block, int stride); 00078 void ff_h264_idct_dc_add_neon(uint8_t *dst, DCTELEM *block, int stride); 00079 void ff_h264_idct_add16_neon(uint8_t *dst, const int *block_offset, 00080 DCTELEM *block, int stride, 00081 const uint8_t nnzc[6*8]); 00082 void ff_h264_idct_add16intra_neon(uint8_t *dst, const int *block_offset, 00083 DCTELEM *block, int stride, 00084 const uint8_t nnzc[6*8]); 00085 void ff_h264_idct_add8_neon(uint8_t **dest, const int *block_offset, 00086 DCTELEM *block, int stride, 00087 const uint8_t nnzc[6*8]); 00088 00089 void ff_h264_idct8_add_neon(uint8_t *dst, DCTELEM *block, int stride); 00090 void ff_h264_idct8_dc_add_neon(uint8_t *dst, DCTELEM *block, int stride); 00091 void ff_h264_idct8_add4_neon(uint8_t *dst, const int *block_offset, 00092 DCTELEM *block, int stride, 00093 const uint8_t nnzc[6*8]); 00094 00095 static void ff_h264dsp_init_neon(H264DSPContext *c, const int bit_depth) 00096 { 00097 if (bit_depth == 8) { 00098 c->h264_v_loop_filter_luma = ff_h264_v_loop_filter_luma_neon; 00099 c->h264_h_loop_filter_luma = ff_h264_h_loop_filter_luma_neon; 00100 c->h264_v_loop_filter_chroma = ff_h264_v_loop_filter_chroma_neon; 00101 c->h264_h_loop_filter_chroma = ff_h264_h_loop_filter_chroma_neon; 00102 00103 c->weight_h264_pixels_tab[0] = ff_weight_h264_pixels_16x16_neon; 00104 c->weight_h264_pixels_tab[1] = ff_weight_h264_pixels_16x8_neon; 00105 c->weight_h264_pixels_tab[2] = ff_weight_h264_pixels_8x16_neon; 00106 c->weight_h264_pixels_tab[3] = ff_weight_h264_pixels_8x8_neon; 00107 c->weight_h264_pixels_tab[4] = ff_weight_h264_pixels_8x4_neon; 00108 c->weight_h264_pixels_tab[5] = ff_weight_h264_pixels_4x8_neon; 00109 c->weight_h264_pixels_tab[6] = ff_weight_h264_pixels_4x4_neon; 00110 c->weight_h264_pixels_tab[7] = ff_weight_h264_pixels_4x2_neon; 00111 00112 c->biweight_h264_pixels_tab[0] = ff_biweight_h264_pixels_16x16_neon; 00113 c->biweight_h264_pixels_tab[1] = ff_biweight_h264_pixels_16x8_neon; 00114 c->biweight_h264_pixels_tab[2] = ff_biweight_h264_pixels_8x16_neon; 00115 c->biweight_h264_pixels_tab[3] = ff_biweight_h264_pixels_8x8_neon; 00116 c->biweight_h264_pixels_tab[4] = ff_biweight_h264_pixels_8x4_neon; 00117 c->biweight_h264_pixels_tab[5] = ff_biweight_h264_pixels_4x8_neon; 00118 c->biweight_h264_pixels_tab[6] = ff_biweight_h264_pixels_4x4_neon; 00119 c->biweight_h264_pixels_tab[7] = ff_biweight_h264_pixels_4x2_neon; 00120 00121 c->h264_idct_add = ff_h264_idct_add_neon; 00122 c->h264_idct_dc_add = ff_h264_idct_dc_add_neon; 00123 c->h264_idct_add16 = ff_h264_idct_add16_neon; 00124 c->h264_idct_add16intra = ff_h264_idct_add16intra_neon; 00125 c->h264_idct_add8 = ff_h264_idct_add8_neon; 00126 c->h264_idct8_add = ff_h264_idct8_add_neon; 00127 c->h264_idct8_dc_add = ff_h264_idct8_dc_add_neon; 00128 c->h264_idct8_add4 = ff_h264_idct8_add4_neon; 00129 } 00130 } 00131 00132 void ff_h264dsp_init_arm(H264DSPContext *c, const int bit_depth) 00133 { 00134 if (HAVE_NEON) ff_h264dsp_init_neon(c, bit_depth); 00135 }