Showing the changes to libavcodec/arm (5 of 21 files). Show all
Unified · Split
| @@ -21,6 +21,7 @@ OBJS-$(CONFIG_IDCTDSP) += arm/idctdsp_init_arm.o \ · 20 unmodified lines | |||
| 21 | arm/simple_idct_arm.o | 21 | arm/simple_idct_arm.o |
| 22 | OBJS-$(CONFIG_MPEGAUDIODSP) += arm/mpegaudiodsp_init_arm.o | 22 | OBJS-$(CONFIG_MPEGAUDIODSP) += arm/mpegaudiodsp_init_arm.o |
| 23 | OBJS-$(CONFIG_MPEGVIDEO) += arm/mpegvideo_arm.o | 23 | OBJS-$(CONFIG_MPEGVIDEO) += arm/mpegvideo_arm.o |
| 24 | OBJS-$(CONFIG_MPEGVIDEOENC) += arm/mpegvideoencdsp_init_arm.o | ||
| 24 | OBJS-$(CONFIG_NEON_CLOBBER_TEST) += arm/neontest.o | 25 | OBJS-$(CONFIG_NEON_CLOBBER_TEST) += arm/neontest.o |
| 25 | OBJS-$(CONFIG_VIDEODSP) += arm/videodsp_init_arm.o | 26 | OBJS-$(CONFIG_VIDEODSP) += arm/videodsp_init_arm.o |
| 26 | OBJS-$(CONFIG_VP3DSP) += arm/vp3dsp_init_arm.o | 27 | OBJS-$(CONFIG_VP3DSP) += arm/vp3dsp_init_arm.o |
| @@ -60,6 +61,7 @@ ARMV6-OBJS-$(CONFIG_IDCTDSP) += arm/idctdsp_init_armv6.o \ · 33 unmodified lines | |||
| 60 | arm/idctdsp_armv6.o \ | 61 | arm/idctdsp_armv6.o \ |
| 61 | arm/simple_idct_armv6.o | 62 | arm/simple_idct_armv6.o |
| 62 | ARMV6-OBJS-$(CONFIG_MPEGAUDIODSP) += arm/mpegaudiodsp_fixed_armv6.o | 63 | ARMV6-OBJS-$(CONFIG_MPEGAUDIODSP) += arm/mpegaudiodsp_fixed_armv6.o |
| 64 | ARMV6-OBJS-$(CONFIG_MPEGVIDEOENC) += arm/mpegvideoencdsp_armv6.o | ||
| 63 | 65 | ||
| 64 | ARMV6-OBJS-$(CONFIG_MLP_DECODER) += arm/mlpdsp_armv6.o | 66 | ARMV6-OBJS-$(CONFIG_MLP_DECODER) += arm/mlpdsp_armv6.o |
| 65 | ARMV6-OBJS-$(CONFIG_VP7_DECODER) += arm/vp8_armv6.o \ | 67 | ARMV6-OBJS-$(CONFIG_VP7_DECODER) += arm/vp8_armv6.o \ |
| @@ -297,58 +297,3 @@ function ff_sse16_armv6, export=1 · 296 unmodified lines | |||
| 297 | 297 | ||
| 298 | pop {r4-r9, pc} | 298 | pop {r4-r9, pc} |
| 299 | endfunc | 299 | endfunc |
| 300 | |||
| 301 | function ff_pix_norm1_armv6, export=1 | ||
| 302 | push {r4-r6, lr} | ||
| 303 | mov r12, #16 | ||
| 304 | mov lr, #0 | ||
| 305 | 1: | ||
| 306 | ldm r0, {r2-r5} | ||
| 307 | uxtb16 r6, r2 | ||
| 308 | uxtb16 r2, r2, ror #8 | ||
| 309 | smlad lr, r6, r6, lr | ||
| 310 | uxtb16 r6, r3 | ||
| 311 | smlad lr, r2, r2, lr | ||
| 312 | uxtb16 r3, r3, ror #8 | ||
| 313 | smlad lr, r6, r6, lr | ||
| 314 | uxtb16 r6, r4 | ||
| 315 | smlad lr, r3, r3, lr | ||
| 316 | uxtb16 r4, r4, ror #8 | ||
| 317 | smlad lr, r6, r6, lr | ||
| 318 | uxtb16 r6, r5 | ||
| 319 | smlad lr, r4, r4, lr | ||
| 320 | uxtb16 r5, r5, ror #8 | ||
| 321 | smlad lr, r6, r6, lr | ||
| 322 | subs r12, r12, #1 | ||
| 323 | add r0, r0, r1 | ||
| 324 | smlad lr, r5, r5, lr | ||
| 325 | bgt 1b | ||
| 326 | |||
| 327 | mov r0, lr | ||
| 328 | pop {r4-r6, pc} | ||
| 329 | endfunc | ||
| 330 | |||
| 331 | function ff_pix_sum_armv6, export=1 | ||
| 332 | push {r4-r7, lr} | ||
| 333 | mov r12, #16 | ||
| 334 | mov r2, #0 | ||
| 335 | mov r3, #0 | ||
| 336 | mov lr, #0 | ||
| 337 | ldr r4, [r0] | ||
| 338 | 1: | ||
| 339 | subs r12, r12, #1 | ||
| 340 | ldr r5, [r0, #4] | ||
| 341 | usada8 r2, r4, lr, r2 | ||
| 342 | ldr r6, [r0, #8] | ||
| 343 | usada8 r3, r5, lr, r3 | ||
| 344 | ldr r7, [r0, #12] | ||
| 345 | usada8 r2, r6, lr, r2 | ||
| 346 | beq 2f | ||
| 347 | ldr_pre r4, r0, r1 | ||
| 348 | usada8 r3, r7, lr, r3 | ||
| 349 | bgt 1b | ||
| 350 | 2: | ||
| 351 | usada8 r3, r7, lr, r3 | ||
| 352 | add r0, r2, r3 | ||
| 353 | pop {r4-r7, pc} | ||
| 354 | endfunc | ||
| @@ -43,9 +43,6 @@ int ff_pix_abs8_armv6(MpegEncContext *s, uint8_t *blk1, uint8_t *blk2, · 42 unmodified lines | |||
| 43 | int ff_sse16_armv6(MpegEncContext *s, uint8_t *blk1, uint8_t *blk2, | 43 | int ff_sse16_armv6(MpegEncContext *s, uint8_t *blk1, uint8_t *blk2, |
| 44 | int line_size, int h); | 44 | int line_size, int h); |
| 45 | 45 | ||
| 46 | int ff_pix_norm1_armv6(uint8_t *pix, int line_size); | ||
| 47 | int ff_pix_sum_armv6(uint8_t *pix, int line_size); | ||
| 48 | |||
| 49 | av_cold void ff_dsputil_init_armv6(DSPContext *c, AVCodecContext *avctx, | 46 | av_cold void ff_dsputil_init_armv6(DSPContext *c, AVCodecContext *avctx, |
| 50 | unsigned high_bit_depth) | 47 | unsigned high_bit_depth) |
| 51 | { | 48 | { |
| @@ -63,7 +60,4 @@ av_cold void ff_dsputil_init_armv6(DSPContext *c, AVCodecContext *avctx, · 11 unmodified lines | |||
| 63 | c->sad[1] = ff_pix_abs8_armv6; | 60 | c->sad[1] = ff_pix_abs8_armv6; |
| 64 | 61 | ||
| 65 | c->sse[0] = ff_sse16_armv6; | 62 | c->sse[0] = ff_sse16_armv6; |
| 66 | |||
| 67 | c->pix_norm1 = ff_pix_norm1_armv6; | ||
| 68 | c->pix_sum = ff_pix_sum_armv6; | ||
| 69 | } | 63 | } |
| @@ -0,0 +1,76 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2009 Mans Rullgard <mans@mansr.com> | ||
| 3 | * | ||
| 4 | * This file is part of Libav. | ||
| 5 | * | ||
| 6 | * Libav is free software; you can redistribute it and/or | ||
| 7 | * modify it under the terms of the GNU Lesser General Public | ||
| 8 | * License as published by the Free Software Foundation; either | ||
| 9 | * version 2.1 of the License, or (at your option) any later version. | ||
| 10 | * | ||
| 11 | * Libav is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 14 | * Lesser General Public License for more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU Lesser General Public | ||
| 17 | * License along with Libav; if not, write to the Free Software | ||
| 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 19 | */ | ||
| 20 | |||
| 21 | #include "libavutil/arm/asm.S" | ||
| 22 | |||
| 23 | function ff_pix_norm1_armv6, export=1 | ||
| 24 | push {r4-r6, lr} | ||
| 25 | mov r12, #16 | ||
| 26 | mov lr, #0 | ||
| 27 | 1: | ||
| 28 | ldm r0, {r2-r5} | ||
| 29 | uxtb16 r6, r2 | ||
| 30 | uxtb16 r2, r2, ror #8 | ||
| 31 | smlad lr, r6, r6, lr | ||
| 32 | uxtb16 r6, r3 | ||
| 33 | smlad lr, r2, r2, lr | ||
| 34 | uxtb16 r3, r3, ror #8 | ||
| 35 | smlad lr, r6, r6, lr | ||
| 36 | uxtb16 r6, r4 | ||
| 37 | smlad lr, r3, r3, lr | ||
| 38 | uxtb16 r4, r4, ror #8 | ||
| 39 | smlad lr, r6, r6, lr | ||
| 40 | uxtb16 r6, r5 | ||
| 41 | smlad lr, r4, r4, lr | ||
| 42 | uxtb16 r5, r5, ror #8 | ||
| 43 | smlad lr, r6, r6, lr | ||
| 44 | subs r12, r12, #1 | ||
| 45 | add r0, r0, r1 | ||
| 46 | smlad lr, r5, r5, lr | ||
| 47 | bgt 1b | ||
| 48 | |||
| 49 | mov r0, lr | ||
| 50 | pop {r4-r6, pc} | ||
| 51 | endfunc | ||
| 52 | |||
| 53 | function ff_pix_sum_armv6, export=1 | ||
| 54 | push {r4-r7, lr} | ||
| 55 | mov r12, #16 | ||
| 56 | mov r2, #0 | ||
| 57 | mov r3, #0 | ||
| 58 | mov lr, #0 | ||
| 59 | ldr r4, [r0] | ||
| 60 | 1: | ||
| 61 | subs r12, r12, #1 | ||
| 62 | ldr r5, [r0, #4] | ||
| 63 | usada8 r2, r4, lr, r2 | ||
| 64 | ldr r6, [r0, #8] | ||
| 65 | usada8 r3, r5, lr, r3 | ||
| 66 | ldr r7, [r0, #12] | ||
| 67 | usada8 r2, r6, lr, r2 | ||
| 68 | beq 2f | ||
| 69 | ldr_pre r4, r0, r1 | ||
| 70 | usada8 r3, r7, lr, r3 | ||
| 71 | bgt 1b | ||
| 72 | 2: | ||
| 73 | usada8 r3, r7, lr, r3 | ||
| 74 | add r0, r2, r3 | ||
| 75 | pop {r4-r7, pc} | ||
| 76 | endfunc | ||
| @@ -0,0 +1,38 @@ | |||
| 1 | /* | ||
| 2 | * This file is part of Libav. | ||
| 3 | * | ||
| 4 | * Libav is free software; you can redistribute it and/or | ||
| 5 | * modify it under the terms of the GNU Lesser General Public | ||
| 6 | * License as published by the Free Software Foundation; either | ||
| 7 | * version 2.1 of the License, or (at your option) any later version. | ||
| 8 | * | ||
| 9 | * Libav is distributed in the hope that it will be useful, | ||
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 12 | * Lesser General Public License for more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU Lesser General Public | ||
| 15 | * License along with Libav; if not, write to the Free Software | ||
| 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 17 | */ | ||
| 18 | |||
| 19 | #include <stdint.h> | ||
| 20 | |||
| 21 | #include "libavutil/cpu.h" | ||
| 22 | #include "libavutil/arm/cpu.h" | ||
| 23 | #include "libavcodec/avcodec.h" | ||
| 24 | #include "libavcodec/mpegvideoencdsp.h" | ||
| 25 | |||
| 26 | int ff_pix_norm1_armv6(uint8_t *pix, int line_size); | ||
| 27 | int ff_pix_sum_armv6(uint8_t *pix, int line_size); | ||
| 28 | |||
| 29 | av_cold void ff_mpegvideoencdsp_init_arm(MpegvideoEncDSPContext *c, | ||
| 30 | AVCodecContext *avctx) | ||
| 31 | { | ||
| 32 | int cpu_flags = av_get_cpu_flags(); | ||
| 33 | |||
| 34 | if (have_armv6(cpu_flags)) { | ||
| 35 | c->pix_norm1 = ff_pix_norm1_armv6; | ||
| 36 | c->pix_sum = ff_pix_sum_armv6; | ||
| 37 | } | ||
| 38 | } | ||