00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include "libavcodec/dsputil.h"
00023 #include "dsputil_arm.h"
00024
00025 void ff_j_rev_dct_arm(DCTELEM *data);
00026 void ff_simple_idct_arm(DCTELEM *data);
00027
00028
00029 static void (*ff_put_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size);
00030 static void (*ff_add_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size);
00031
00032 void ff_put_pixels8_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
00033 void ff_put_pixels8_x2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
00034 void ff_put_pixels8_y2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
00035 void ff_put_pixels8_xy2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
00036
00037 void ff_put_no_rnd_pixels8_x2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
00038 void ff_put_no_rnd_pixels8_y2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
00039 void ff_put_no_rnd_pixels8_xy2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
00040
00041 void ff_put_pixels16_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
00042
00043 CALL_2X_PIXELS(ff_put_pixels16_x2_arm, ff_put_pixels8_x2_arm, 8)
00044 CALL_2X_PIXELS(ff_put_pixels16_y2_arm, ff_put_pixels8_y2_arm, 8)
00045 CALL_2X_PIXELS(ff_put_pixels16_xy2_arm, ff_put_pixels8_xy2_arm, 8)
00046 CALL_2X_PIXELS(ff_put_no_rnd_pixels16_x2_arm, ff_put_no_rnd_pixels8_x2_arm, 8)
00047 CALL_2X_PIXELS(ff_put_no_rnd_pixels16_y2_arm, ff_put_no_rnd_pixels8_y2_arm, 8)
00048 CALL_2X_PIXELS(ff_put_no_rnd_pixels16_xy2_arm, ff_put_no_rnd_pixels8_xy2_arm,8)
00049
00050 void ff_add_pixels_clamped_arm(const DCTELEM *block, uint8_t *dest,
00051 int line_size);
00052
00053
00054
00055 static void j_rev_dct_arm_put(uint8_t *dest, int line_size, DCTELEM *block)
00056 {
00057 ff_j_rev_dct_arm (block);
00058 ff_put_pixels_clamped(block, dest, line_size);
00059 }
00060 static void j_rev_dct_arm_add(uint8_t *dest, int line_size, DCTELEM *block)
00061 {
00062 ff_j_rev_dct_arm (block);
00063 ff_add_pixels_clamped(block, dest, line_size);
00064 }
00065 static void simple_idct_arm_put(uint8_t *dest, int line_size, DCTELEM *block)
00066 {
00067 ff_simple_idct_arm (block);
00068 ff_put_pixels_clamped(block, dest, line_size);
00069 }
00070 static void simple_idct_arm_add(uint8_t *dest, int line_size, DCTELEM *block)
00071 {
00072 ff_simple_idct_arm (block);
00073 ff_add_pixels_clamped(block, dest, line_size);
00074 }
00075
00076 void dsputil_init_arm(DSPContext* c, AVCodecContext *avctx)
00077 {
00078 const int high_bit_depth = avctx->bits_per_raw_sample > 8;
00079
00080 ff_put_pixels_clamped = c->put_pixels_clamped;
00081 ff_add_pixels_clamped = c->add_pixels_clamped;
00082
00083 if (!avctx->lowres && avctx->bits_per_raw_sample <= 8) {
00084 if(avctx->idct_algo == FF_IDCT_AUTO ||
00085 avctx->idct_algo == FF_IDCT_ARM){
00086 c->idct_put = j_rev_dct_arm_put;
00087 c->idct_add = j_rev_dct_arm_add;
00088 c->idct = ff_j_rev_dct_arm;
00089 c->idct_permutation_type = FF_LIBMPEG2_IDCT_PERM;
00090 } else if (avctx->idct_algo == FF_IDCT_SIMPLEARM){
00091 c->idct_put = simple_idct_arm_put;
00092 c->idct_add = simple_idct_arm_add;
00093 c->idct = ff_simple_idct_arm;
00094 c->idct_permutation_type = FF_NO_IDCT_PERM;
00095 }
00096 }
00097
00098 c->add_pixels_clamped = ff_add_pixels_clamped_arm;
00099
00100 if (!high_bit_depth) {
00101 c->put_pixels_tab[0][0] = ff_put_pixels16_arm;
00102 c->put_pixels_tab[0][1] = ff_put_pixels16_x2_arm;
00103 c->put_pixels_tab[0][2] = ff_put_pixels16_y2_arm;
00104 c->put_pixels_tab[0][3] = ff_put_pixels16_xy2_arm;
00105 c->put_pixels_tab[1][0] = ff_put_pixels8_arm;
00106 c->put_pixels_tab[1][1] = ff_put_pixels8_x2_arm;
00107 c->put_pixels_tab[1][2] = ff_put_pixels8_y2_arm;
00108 c->put_pixels_tab[1][3] = ff_put_pixels8_xy2_arm;
00109
00110 c->put_no_rnd_pixels_tab[0][0] = ff_put_pixels16_arm;
00111 c->put_no_rnd_pixels_tab[0][1] = ff_put_no_rnd_pixels16_x2_arm;
00112 c->put_no_rnd_pixels_tab[0][2] = ff_put_no_rnd_pixels16_y2_arm;
00113 c->put_no_rnd_pixels_tab[0][3] = ff_put_no_rnd_pixels16_xy2_arm;
00114 c->put_no_rnd_pixels_tab[1][0] = ff_put_pixels8_arm;
00115 c->put_no_rnd_pixels_tab[1][1] = ff_put_no_rnd_pixels8_x2_arm;
00116 c->put_no_rnd_pixels_tab[1][2] = ff_put_no_rnd_pixels8_y2_arm;
00117 c->put_no_rnd_pixels_tab[1][3] = ff_put_no_rnd_pixels8_xy2_arm;
00118 }
00119
00120 if (HAVE_ARMV5TE) ff_dsputil_init_armv5te(c, avctx);
00121 if (HAVE_ARMV6) ff_dsputil_init_armv6(c, avctx);
00122 if (HAVE_IWMMXT) ff_dsputil_init_iwmmxt(c, avctx);
00123 if (HAVE_ARMVFP) ff_dsputil_init_vfp(c, avctx);
00124 if (HAVE_NEON) ff_dsputil_init_neon(c, avctx);
00125 }