Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
7abc8e7a
Commit
7abc8e7a
authored
Apr 07, 2016
by
Matthieu Bouron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swscale/arm: add ff_hscale_8_to_15_neon
parent
dee13862
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
114 additions
and
2 deletions
+114
-2
Makefile
libswscale/arm/Makefile
+4
-2
hscale.S
libswscale/arm/hscale.S
+70
-0
swscale.c
libswscale/arm/swscale.c
+37
-0
swscale.c
libswscale/swscale.c
+2
-0
swscale_internal.h
libswscale/swscale_internal.h
+1
-0
No files found.
libswscale/arm/Makefile
View file @
7abc8e7a
OBJS
+=
arm/swscale_unscaled.o
OBJS
+=
arm/swscale.o
\
arm/swscale_unscaled.o
\
NEON-OBJS
+=
arm/rgb2yuv_neon_32.o
NEON-OBJS
+=
arm/rgb2yuv_neon_32.o
NEON-OBJS
+=
arm/rgb2yuv_neon_16.o
NEON-OBJS
+=
arm/rgb2yuv_neon_16.o
NEON-OBJS
+=
arm/yuv2rgb_neon.o
NEON-OBJS
+=
arm/hscale.o
\
arm/yuv2rgb_neon.o
\
libswscale/arm/hscale.S
0 → 100644
View file @
7abc8e7a
/*
* Copyright (c) 2016 Clément Bœsch <clement stupeflix.com>
* Copyright (c) 2016 Matthieu Bouron <matthieu.bouron stupeflix.com>
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavutil/arm/asm.S"
function ff_hscale_8_to_15_neon, export=1
push {r4-r12, lr}
vpush {q4-q7}
ldr r4, [sp, #104] @ filter
ldr r5, [sp, #108] @ filterPos
ldr r6, [sp, #112] @ filterSize
add r10, r4, r6, lsl #1 @ filter2 = filter + filterSize * 2
1: ldr r8, [r5], #4 @ filterPos[0]
ldr r9, [r5], #4 @ filterPos[1]
vmov.s32 q4, #0 @ val accumulator
vmov.s32 q5, #0 @ val accumulator
mov r7, r6 @ tmpfilterSize = filterSize
mov r0, r3 @ srcp
2: add r11, r0, r8 @ srcp + filterPos[0]
add r12, r0, r9 @ srcp + filterPos[1]
vld1.8 d0, [r11] @ srcp[filterPos[0] + {0..7}]
vld1.8 d2, [r12] @ srcp[filterPos[1] + {0..7}]
vld1.16 {q2}, [r4]! @ load 8x16-bit filter values
vld1.16 {q3}, [r10]! @ load 8x16-bit filter values
vmovl.u8 q0, d0 @ unpack src values to 16-bit
vmovl.u8 q1, d2 @ unpack src values to 16-bit
vmull.s16 q8, d0, d4 @ srcp[filterPos[0] + {0..7}] * filter[{0..7}] (part 1)
vmull.s16 q9, d1, d5 @ srcp[filterPos[0] + {0..7}] * filter[{0..7}] (part 2)
vmull.s16 q10, d2, d6 @ srcp[filterPos[1] + {0..7}] * filter[{0..7}] (part 1)
vmull.s16 q11, d3, d7 @ srcp[filterPos[1] + {0..7}] * filter[{0..7}] (part 2)
vpadd.s32 d16, d16, d17 @ horizontal pair adding of the 8x32-bit multiplied values into 4x32-bit (part 1)
vpadd.s32 d17, d18, d19 @ horizontal pair adding of the 8x32-bit multiplied values into 4x32-bit (part 2)
vpadd.s32 d20, d20, d21 @ horizontal pair adding of the 8x32-bit multiplied values into 4x32-bit (part 1)
vpadd.s32 d21, d22, d23 @ horizontal pair adding of the 8x32-bit multiplied values into 4x32-bit (part 2)
vadd.s32 q4, q8 @ update val accumulator
vadd.s32 q5, q10 @ update val accumulator
add r0, #8 @ srcp += 8
subs r7, #8 @ tmpfilterSize -= 8
bgt 2b @ loop until tmpfilterSize is consumed
mov r4, r10 @ filter = filter2
add r10, r10, r6, lsl #1 @ filter2 += filterSize * 2
vpadd.s32 d8, d8, d9 @ horizontal pair adding of the 8x32-bit sums into 4x32-bit (part 1)
vpadd.s32 d9, d10, d11 @ horizontal pair adding of the 8x32-bit sums into 4x32-bit (part 2)
vpadd.s32 d8, d8, d9 @ horizontal pair adding of the 4x32-bit sums into 2x32-bit
vqshrn.s32 d8, q4, #7 @ shift and clip the 2x16-bit final values
vst1.32 {d8[0]},[r1]! @ write destination
subs r2, #2 @ dstW -= 2
bgt 1b @ loop until end of line
vpop {q4-q7}
pop {r4-r12, lr}
mov pc, lr
endfunc
libswscale/arm/swscale.c
0 → 100644
View file @
7abc8e7a
/*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "config.h"
#include "libswscale/swscale.h"
#include "libswscale/swscale_internal.h"
#include "libavutil/arm/cpu.h"
void
ff_hscale_8_to_15_neon
(
SwsContext
*
c
,
int16_t
*
dst
,
int
dstW
,
const
uint8_t
*
src
,
const
int16_t
*
filter
,
const
int32_t
*
filterPos
,
int
filterSize
);
av_cold
void
ff_sws_init_swscale_arm
(
SwsContext
*
c
)
{
int
cpu_flags
=
av_get_cpu_flags
();
if
(
have_neon
(
cpu_flags
))
{
if
(
c
->
srcBpc
==
8
&&
c
->
dstBpc
<=
14
)
{
c
->
hyScale
=
c
->
hcScale
=
ff_hscale_8_to_15_neon
;
}
}
}
libswscale/swscale.c
View file @
7abc8e7a
...
@@ -597,6 +597,8 @@ SwsFunc ff_getSwsFunc(SwsContext *c)
...
@@ -597,6 +597,8 @@ SwsFunc ff_getSwsFunc(SwsContext *c)
ff_sws_init_swscale_x86
(
c
);
ff_sws_init_swscale_x86
(
c
);
if
(
ARCH_AARCH64
)
if
(
ARCH_AARCH64
)
ff_sws_init_swscale_aarch64
(
c
);
ff_sws_init_swscale_aarch64
(
c
);
if
(
ARCH_ARM
)
ff_sws_init_swscale_arm
(
c
);
return
swscale
;
return
swscale
;
}
}
...
...
libswscale/swscale_internal.h
View file @
7abc8e7a
...
@@ -892,6 +892,7 @@ void ff_sws_init_output_funcs(SwsContext *c,
...
@@ -892,6 +892,7 @@ void ff_sws_init_output_funcs(SwsContext *c,
void
ff_sws_init_swscale_ppc
(
SwsContext
*
c
);
void
ff_sws_init_swscale_ppc
(
SwsContext
*
c
);
void
ff_sws_init_swscale_x86
(
SwsContext
*
c
);
void
ff_sws_init_swscale_x86
(
SwsContext
*
c
);
void
ff_sws_init_swscale_aarch64
(
SwsContext
*
c
);
void
ff_sws_init_swscale_aarch64
(
SwsContext
*
c
);
void
ff_sws_init_swscale_arm
(
SwsContext
*
c
);
void
ff_hyscale_fast_c
(
SwsContext
*
c
,
int16_t
*
dst
,
int
dstWidth
,
void
ff_hyscale_fast_c
(
SwsContext
*
c
,
int16_t
*
dst
,
int
dstWidth
,
const
uint8_t
*
src
,
int
srcW
,
int
xInc
);
const
uint8_t
*
src
,
int
srcW
,
int
xInc
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment