Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
c8c4a162
Commit
c8c4a162
authored
Sep 22, 2022
by
James Almer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/lpc: use ptrdiff_t for length parameters
Signed-off-by:
James Almer
<
jamrial@gmail.com
>
parent
a2d95928
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
9 deletions
+9
-9
lpc.c
libavcodec/lpc.c
+2
-2
lpc.h
libavcodec/lpc.h
+3
-2
lpc.asm
libavcodec/x86/lpc.asm
+0
-1
lpc_init.c
libavcodec/x86/lpc_init.c
+3
-3
lpc.c
tests/checkasm/lpc.c
+1
-1
No files found.
libavcodec/lpc.c
View file @
c8c4a162
...
...
@@ -31,7 +31,7 @@
/**
* Apply Welch window function to audio block
*/
static
void
lpc_apply_welch_window_c
(
const
int32_t
*
data
,
in
t
len
,
static
void
lpc_apply_welch_window_c
(
const
int32_t
*
data
,
ptrdiff_
t
len
,
double
*
w_data
)
{
int
i
,
n2
;
...
...
@@ -70,7 +70,7 @@ static void lpc_apply_welch_window_c(const int32_t *data, int len,
* Calculate autocorrelation data from audio samples
* A Welch window function is applied before calculation.
*/
static
void
lpc_compute_autocorr_c
(
const
double
*
data
,
in
t
len
,
int
lag
,
static
void
lpc_compute_autocorr_c
(
const
double
*
data
,
ptrdiff_
t
len
,
int
lag
,
double
*
autoc
)
{
int
i
,
j
;
...
...
libavcodec/lpc.h
View file @
c8c4a162
...
...
@@ -23,6 +23,7 @@
#define AVCODEC_LPC_H
#include <stdint.h>
#include <stddef.h>
#include "libavutil/avassert.h"
#include "libavutil/lls.h"
#include "aac_defines.h"
...
...
@@ -64,7 +65,7 @@ typedef struct LPCContext {
* @param len number of input samples
* @param w_data output samples
*/
void
(
*
lpc_apply_welch_window
)(
const
int32_t
*
data
,
in
t
len
,
void
(
*
lpc_apply_welch_window
)(
const
int32_t
*
data
,
ptrdiff_
t
len
,
double
*
w_data
);
/**
* Perform autocorrelation on input samples with delay of 0 to lag.
...
...
@@ -79,7 +80,7 @@ typedef struct LPCContext {
* @param autoc output autocorrelation coefficients.
* constraints: array size must be at least lag+1.
*/
void
(
*
lpc_compute_autocorr
)(
const
double
*
data
,
in
t
len
,
int
lag
,
void
(
*
lpc_compute_autocorr
)(
const
double
*
data
,
ptrdiff_
t
len
,
int
lag
,
double
*
autoc
);
// TODO: these should be allocated to reduce ABI compatibility issues
...
...
libavcodec/x86/lpc.asm
View file @
c8c4a162
...
...
@@ -36,7 +36,6 @@ SECTION .text
%macro
APPLY_WELCH_FN
0
cglobal
lpc_apply_welch_window
,
3
,
5
,
8
,
data
,
len
,
out
,
off1
,
off2
movsxdifnidn
lenq
,
lend
cmp
lenq
,
0
je
.
end
cmp
lenq
,
2
...
...
libavcodec/x86/lpc_init.c
View file @
c8c4a162
...
...
@@ -24,16 +24,16 @@
#include "libavutil/x86/cpu.h"
#include "libavcodec/lpc.h"
void
ff_lpc_apply_welch_window_sse2
(
const
int32_t
*
data
,
in
t
len
,
void
ff_lpc_apply_welch_window_sse2
(
const
int32_t
*
data
,
ptrdiff_
t
len
,
double
*
w_data
);
void
ff_lpc_apply_welch_window_avx2
(
const
int32_t
*
data
,
in
t
len
,
void
ff_lpc_apply_welch_window_avx2
(
const
int32_t
*
data
,
ptrdiff_
t
len
,
double
*
w_data
);
DECLARE_ASM_CONST
(
16
,
double
,
pd_1
)[
2
]
=
{
1
.
0
,
1
.
0
};
#if HAVE_SSE2_INLINE
static
void
lpc_compute_autocorr_sse2
(
const
double
*
data
,
in
t
len
,
int
lag
,
static
void
lpc_compute_autocorr_sse2
(
const
double
*
data
,
ptrdiff_
t
len
,
int
lag
,
double
*
autoc
)
{
int
j
;
...
...
tests/checkasm/lpc.c
View file @
c8c4a162
...
...
@@ -38,7 +38,7 @@ static void test_window(int len)
LOCAL_ALIGNED
(
16
,
double
,
dst0
,
[
5000
]);
LOCAL_ALIGNED
(
16
,
double
,
dst1
,
[
5000
]);
declare_func
(
void
,
int32_t
*
in
,
in
t
len
,
double
*
out
);
declare_func
(
void
,
const
int32_t
*
in
,
ptrdiff_
t
len
,
double
*
out
);
randomize_int32
(
src
,
len
);
...
...
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