diff --git a/libavcodec/arm/dsputil_arm.h b/libavcodec/arm/dsputil_arm.h index 4ac8019202..cc14b2c4f3 100644 --- a/libavcodec/arm/dsputil_arm.h +++ b/libavcodec/arm/dsputil_arm.h @@ -24,8 +24,8 @@ #include "libavcodec/avcodec.h" #include "libavcodec/dsputil.h" -void ff_dsputil_init_armv5te(DSPContext* c, AVCodecContext *avctx); -void ff_dsputil_init_armv6(DSPContext* c, AVCodecContext *avctx); +void ff_dsputil_init_armv5te(DSPContext *c, AVCodecContext *avctx); +void ff_dsputil_init_armv6(DSPContext *c, AVCodecContext *avctx); void ff_dsputil_init_neon(DSPContext *c, AVCodecContext *avctx); #endif /* AVCODEC_ARM_DSPUTIL_ARM_H */ diff --git a/libavcodec/arm/dsputil_init_arm.c b/libavcodec/arm/dsputil_init_arm.c index 358734b109..2c348ecb0d 100644 --- a/libavcodec/arm/dsputil_init_arm.c +++ b/libavcodec/arm/dsputil_init_arm.c @@ -39,25 +39,28 @@ void ff_add_pixels_clamped_arm(const int16_t *block, uint8_t *dest, int line_size); /* XXX: those functions should be suppressed ASAP when all IDCTs are - converted */ + * converted */ static void j_rev_dct_arm_put(uint8_t *dest, int line_size, int16_t *block) { - ff_j_rev_dct_arm (block); + ff_j_rev_dct_arm(block); ff_put_pixels_clamped(block, dest, line_size); } + static void j_rev_dct_arm_add(uint8_t *dest, int line_size, int16_t *block) { - ff_j_rev_dct_arm (block); + ff_j_rev_dct_arm(block); ff_add_pixels_clamped(block, dest, line_size); } + static void simple_idct_arm_put(uint8_t *dest, int line_size, int16_t *block) { - ff_simple_idct_arm (block); + ff_simple_idct_arm(block); ff_put_pixels_clamped(block, dest, line_size); } + static void simple_idct_arm_add(uint8_t *dest, int line_size, int16_t *block) { - ff_simple_idct_arm (block); + ff_simple_idct_arm(block); ff_add_pixels_clamped(block, dest, line_size); } @@ -69,13 +72,13 @@ av_cold void ff_dsputil_init_arm(DSPContext *c, AVCodecContext *avctx) ff_add_pixels_clamped = c->add_pixels_clamped; if (avctx->bits_per_raw_sample <= 8) { - if(avctx->idct_algo == FF_IDCT_AUTO || - avctx->idct_algo == FF_IDCT_ARM){ + if (avctx->idct_algo == FF_IDCT_AUTO || + avctx->idct_algo == FF_IDCT_ARM) { c->idct_put = j_rev_dct_arm_put; c->idct_add = j_rev_dct_arm_add; c->idct = ff_j_rev_dct_arm; c->idct_permutation_type = FF_LIBMPEG2_IDCT_PERM; - } else if (avctx->idct_algo == FF_IDCT_SIMPLEARM){ + } else if (avctx->idct_algo == FF_IDCT_SIMPLEARM) { c->idct_put = simple_idct_arm_put; c->idct_add = simple_idct_arm_add; c->idct = ff_simple_idct_arm; @@ -85,7 +88,10 @@ av_cold void ff_dsputil_init_arm(DSPContext *c, AVCodecContext *avctx) c->add_pixels_clamped = ff_add_pixels_clamped_arm; - if (have_armv5te(cpu_flags)) ff_dsputil_init_armv5te(c, avctx); - if (have_armv6(cpu_flags)) ff_dsputil_init_armv6(c, avctx); - if (have_neon(cpu_flags)) ff_dsputil_init_neon(c, avctx); + if (have_armv5te(cpu_flags)) + ff_dsputil_init_armv5te(c, avctx); + if (have_armv6(cpu_flags)) + ff_dsputil_init_armv6(c, avctx); + if (have_neon(cpu_flags)) + ff_dsputil_init_neon(c, avctx); } diff --git a/libavcodec/arm/dsputil_init_armv6.c b/libavcodec/arm/dsputil_init_armv6.c index 09a30cfdf3..f412ff2a94 100644 --- a/libavcodec/arm/dsputil_init_armv6.c +++ b/libavcodec/arm/dsputil_init_armv6.c @@ -44,7 +44,7 @@ int ff_pix_abs16_y2_armv6(void *s, uint8_t *blk1, uint8_t *blk2, int line_size, int h); int ff_pix_abs8_armv6(void *s, uint8_t *blk1, uint8_t *blk2, - int line_size, int h); + int line_size, int h); int ff_sse16_armv6(void *s, uint8_t *blk1, uint8_t *blk2, int line_size, int h); @@ -64,10 +64,10 @@ av_cold void ff_dsputil_init_armv6(DSPContext *c, AVCodecContext *avctx) c->idct = ff_simple_idct_armv6; c->idct_permutation_type = FF_LIBMPEG2_IDCT_PERM; } + c->add_pixels_clamped = ff_add_pixels_clamped_armv6; if (!high_bit_depth) c->get_pixels = ff_get_pixels_armv6; - c->add_pixels_clamped = ff_add_pixels_clamped_armv6; c->diff_pixels = ff_diff_pixels_armv6; c->pix_abs[0][0] = ff_pix_abs16_armv6; diff --git a/libavcodec/arm/dsputil_init_neon.c b/libavcodec/arm/dsputil_init_neon.c index f30be97681..c39fcc172a 100644 --- a/libavcodec/arm/dsputil_init_neon.c +++ b/libavcodec/arm/dsputil_init_neon.c @@ -43,6 +43,7 @@ void ff_vector_clip_int32_neon(int32_t *dst, const int32_t *src, int32_t min, int32_t max, unsigned int len); int32_t ff_scalarproduct_int16_neon(const int16_t *v1, const int16_t *v2, int len); + int32_t ff_scalarproduct_and_madd_int16_neon(int16_t *v1, const int16_t *v2, const int16_t *v3, int len, int mul); @@ -60,18 +61,19 @@ av_cold void ff_dsputil_init_neon(DSPContext *c, AVCodecContext *avctx) } } + c->add_pixels_clamped = ff_add_pixels_clamped_neon; + c->put_pixels_clamped = ff_put_pixels_clamped_neon; + c->put_signed_pixels_clamped = ff_put_signed_pixels_clamped_neon; + if (!high_bit_depth) { c->clear_block = ff_clear_block_neon; c->clear_blocks = ff_clear_blocks_neon; } - c->add_pixels_clamped = ff_add_pixels_clamped_neon; - c->put_pixels_clamped = ff_put_pixels_clamped_neon; - c->put_signed_pixels_clamped = ff_put_signed_pixels_clamped_neon; - - c->vector_clipf = ff_vector_clipf_neon; - c->vector_clip_int32 = ff_vector_clip_int32_neon; + c->vector_clipf = ff_vector_clipf_neon; + c->vector_clip_int32 = ff_vector_clip_int32_neon; c->scalarproduct_int16 = ff_scalarproduct_int16_neon; + c->scalarproduct_and_madd_int16 = ff_scalarproduct_and_madd_int16_neon; }