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 "libavcodec/avcodec.h"
00024 #include "libavcodec/dsputil.h"
00025 #include "dsputil_arm.h"
00026
00027 void ff_simple_idct_armv6(DCTELEM *data);
00028 void ff_simple_idct_put_armv6(uint8_t *dest, int line_size, DCTELEM *data);
00029 void ff_simple_idct_add_armv6(uint8_t *dest, int line_size, DCTELEM *data);
00030
00031 void ff_put_pixels16_armv6(uint8_t *, const uint8_t *, int, int);
00032 void ff_put_pixels16_x2_armv6(uint8_t *, const uint8_t *, int, int);
00033 void ff_put_pixels16_y2_armv6(uint8_t *, const uint8_t *, int, int);
00034
00035 void ff_put_pixels16_x2_no_rnd_armv6(uint8_t *, const uint8_t *, int, int);
00036 void ff_put_pixels16_y2_no_rnd_armv6(uint8_t *, const uint8_t *, int, int);
00037
00038 void ff_avg_pixels16_armv6(uint8_t *, const uint8_t *, int, int);
00039
00040 void ff_put_pixels8_armv6(uint8_t *, const uint8_t *, int, int);
00041 void ff_put_pixels8_x2_armv6(uint8_t *, const uint8_t *, int, int);
00042 void ff_put_pixels8_y2_armv6(uint8_t *, const uint8_t *, int, int);
00043
00044 void ff_put_pixels8_x2_no_rnd_armv6(uint8_t *, const uint8_t *, int, int);
00045 void ff_put_pixels8_y2_no_rnd_armv6(uint8_t *, const uint8_t *, int, int);
00046
00047 void ff_avg_pixels8_armv6(uint8_t *, const uint8_t *, int, int);
00048
00049 void ff_add_pixels_clamped_armv6(const DCTELEM *block,
00050 uint8_t *restrict pixels,
00051 int line_size);
00052
00053 void ff_get_pixels_armv6(DCTELEM *block, const uint8_t *pixels, int stride);
00054 void ff_diff_pixels_armv6(DCTELEM *block, const uint8_t *s1,
00055 const uint8_t *s2, int stride);
00056
00057 int ff_pix_abs16_armv6(void *s, uint8_t *blk1, uint8_t *blk2,
00058 int line_size, int h);
00059 int ff_pix_abs16_x2_armv6(void *s, uint8_t *blk1, uint8_t *blk2,
00060 int line_size, int h);
00061 int ff_pix_abs16_y2_armv6(void *s, uint8_t *blk1, uint8_t *blk2,
00062 int line_size, int h);
00063
00064 int ff_pix_abs8_armv6(void *s, uint8_t *blk1, uint8_t *blk2,
00065 int line_size, int h);
00066
00067 int ff_sse16_armv6(void *s, uint8_t *blk1, uint8_t *blk2,
00068 int line_size, int h);
00069
00070 int ff_pix_norm1_armv6(uint8_t *pix, int line_size);
00071 int ff_pix_sum_armv6(uint8_t *pix, int line_size);
00072
00073 void av_cold ff_dsputil_init_armv6(DSPContext* c, AVCodecContext *avctx)
00074 {
00075 const int high_bit_depth = avctx->bits_per_raw_sample > 8;
00076
00077 if (!avctx->lowres && avctx->bits_per_raw_sample <= 8 &&
00078 (avctx->idct_algo == FF_IDCT_AUTO ||
00079 avctx->idct_algo == FF_IDCT_SIMPLEARMV6)) {
00080 c->idct_put = ff_simple_idct_put_armv6;
00081 c->idct_add = ff_simple_idct_add_armv6;
00082 c->idct = ff_simple_idct_armv6;
00083 c->idct_permutation_type = FF_LIBMPEG2_IDCT_PERM;
00084 }
00085
00086 if (!high_bit_depth) {
00087 c->put_pixels_tab[0][0] = ff_put_pixels16_armv6;
00088 c->put_pixels_tab[0][1] = ff_put_pixels16_x2_armv6;
00089 c->put_pixels_tab[0][2] = ff_put_pixels16_y2_armv6;
00090
00091 c->put_pixels_tab[1][0] = ff_put_pixels8_armv6;
00092 c->put_pixels_tab[1][1] = ff_put_pixels8_x2_armv6;
00093 c->put_pixels_tab[1][2] = ff_put_pixels8_y2_armv6;
00094
00095
00096 c->put_no_rnd_pixels_tab[0][0] = ff_put_pixels16_armv6;
00097 c->put_no_rnd_pixels_tab[0][1] = ff_put_pixels16_x2_no_rnd_armv6;
00098 c->put_no_rnd_pixels_tab[0][2] = ff_put_pixels16_y2_no_rnd_armv6;
00099
00100 c->put_no_rnd_pixels_tab[1][0] = ff_put_pixels8_armv6;
00101 c->put_no_rnd_pixels_tab[1][1] = ff_put_pixels8_x2_no_rnd_armv6;
00102 c->put_no_rnd_pixels_tab[1][2] = ff_put_pixels8_y2_no_rnd_armv6;
00103
00104
00105 c->avg_pixels_tab[0][0] = ff_avg_pixels16_armv6;
00106 c->avg_pixels_tab[1][0] = ff_avg_pixels8_armv6;
00107 }
00108
00109 if (!high_bit_depth)
00110 c->get_pixels = ff_get_pixels_armv6;
00111 c->add_pixels_clamped = ff_add_pixels_clamped_armv6;
00112 c->diff_pixels = ff_diff_pixels_armv6;
00113
00114 c->pix_abs[0][0] = ff_pix_abs16_armv6;
00115 c->pix_abs[0][1] = ff_pix_abs16_x2_armv6;
00116 c->pix_abs[0][2] = ff_pix_abs16_y2_armv6;
00117
00118 c->pix_abs[1][0] = ff_pix_abs8_armv6;
00119
00120 c->sad[0] = ff_pix_abs16_armv6;
00121 c->sad[1] = ff_pix_abs8_armv6;
00122
00123 c->sse[0] = ff_sse16_armv6;
00124
00125 c->pix_norm1 = ff_pix_norm1_armv6;
00126 c->pix_sum = ff_pix_sum_armv6;
00127 }