avcodec/lpc: use ptrdiff_t for length parameters
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
		
							parent
							
								
									a2d95928c3
								
							
						
					
					
						commit
						c8c4a162fc
					
				@ -31,7 +31,7 @@
 | 
				
			|||||||
/**
 | 
					/**
 | 
				
			||||||
 * Apply Welch window function to audio block
 | 
					 * Apply Welch window function to audio block
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
static void lpc_apply_welch_window_c(const int32_t *data, int len,
 | 
					static void lpc_apply_welch_window_c(const int32_t *data, ptrdiff_t len,
 | 
				
			||||||
                                     double *w_data)
 | 
					                                     double *w_data)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    int i, n2;
 | 
					    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
 | 
					 * Calculate autocorrelation data from audio samples
 | 
				
			||||||
 * A Welch window function is applied before calculation.
 | 
					 * A Welch window function is applied before calculation.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
static void lpc_compute_autocorr_c(const double *data, int len, int lag,
 | 
					static void lpc_compute_autocorr_c(const double *data, ptrdiff_t len, int lag,
 | 
				
			||||||
                                   double *autoc)
 | 
					                                   double *autoc)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    int i, j;
 | 
					    int i, j;
 | 
				
			||||||
 | 
				
			|||||||
@ -23,6 +23,7 @@
 | 
				
			|||||||
#define AVCODEC_LPC_H
 | 
					#define AVCODEC_LPC_H
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <stdint.h>
 | 
					#include <stdint.h>
 | 
				
			||||||
 | 
					#include <stddef.h>
 | 
				
			||||||
#include "libavutil/avassert.h"
 | 
					#include "libavutil/avassert.h"
 | 
				
			||||||
#include "libavutil/lls.h"
 | 
					#include "libavutil/lls.h"
 | 
				
			||||||
#include "aac_defines.h"
 | 
					#include "aac_defines.h"
 | 
				
			||||||
@ -64,7 +65,7 @@ typedef struct LPCContext {
 | 
				
			|||||||
     * @param len     number of input samples
 | 
					     * @param len     number of input samples
 | 
				
			||||||
     * @param w_data  output samples
 | 
					     * @param w_data  output samples
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    void (*lpc_apply_welch_window)(const int32_t *data, int len,
 | 
					    void (*lpc_apply_welch_window)(const int32_t *data, ptrdiff_t len,
 | 
				
			||||||
                                   double *w_data);
 | 
					                                   double *w_data);
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Perform autocorrelation on input samples with delay of 0 to lag.
 | 
					     * Perform autocorrelation on input samples with delay of 0 to lag.
 | 
				
			||||||
@ -79,7 +80,7 @@ typedef struct LPCContext {
 | 
				
			|||||||
     * @param autoc output autocorrelation coefficients.
 | 
					     * @param autoc output autocorrelation coefficients.
 | 
				
			||||||
     *              constraints: array size must be at least lag+1.
 | 
					     *              constraints: array size must be at least lag+1.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    void (*lpc_compute_autocorr)(const double *data, int len, int lag,
 | 
					    void (*lpc_compute_autocorr)(const double *data, ptrdiff_t len, int lag,
 | 
				
			||||||
                                 double *autoc);
 | 
					                                 double *autoc);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // TODO: these should be allocated to reduce ABI compatibility issues
 | 
					    // TODO: these should be allocated to reduce ABI compatibility issues
 | 
				
			||||||
 | 
				
			|||||||
@ -36,7 +36,6 @@ SECTION .text
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
%macro APPLY_WELCH_FN 0
 | 
					%macro APPLY_WELCH_FN 0
 | 
				
			||||||
cglobal lpc_apply_welch_window, 3, 5, 8, data, len, out, off1, off2
 | 
					cglobal lpc_apply_welch_window, 3, 5, 8, data, len, out, off1, off2
 | 
				
			||||||
    movsxdifnidn lenq, lend
 | 
					 | 
				
			||||||
    cmp lenq, 0
 | 
					    cmp lenq, 0
 | 
				
			||||||
    je .end
 | 
					    je .end
 | 
				
			||||||
    cmp lenq, 2
 | 
					    cmp lenq, 2
 | 
				
			||||||
 | 
				
			|||||||
@ -24,16 +24,16 @@
 | 
				
			|||||||
#include "libavutil/x86/cpu.h"
 | 
					#include "libavutil/x86/cpu.h"
 | 
				
			||||||
#include "libavcodec/lpc.h"
 | 
					#include "libavcodec/lpc.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void ff_lpc_apply_welch_window_sse2(const int32_t *data, int len,
 | 
					void ff_lpc_apply_welch_window_sse2(const int32_t *data, ptrdiff_t len,
 | 
				
			||||||
                                    double *w_data);
 | 
					                                    double *w_data);
 | 
				
			||||||
void ff_lpc_apply_welch_window_avx2(const int32_t *data, int len,
 | 
					void ff_lpc_apply_welch_window_avx2(const int32_t *data, ptrdiff_t len,
 | 
				
			||||||
                                    double *w_data);
 | 
					                                    double *w_data);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
DECLARE_ASM_CONST(16, double, pd_1)[2] = { 1.0, 1.0 };
 | 
					DECLARE_ASM_CONST(16, double, pd_1)[2] = { 1.0, 1.0 };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if HAVE_SSE2_INLINE
 | 
					#if HAVE_SSE2_INLINE
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void lpc_compute_autocorr_sse2(const double *data, int len, int lag,
 | 
					static void lpc_compute_autocorr_sse2(const double *data, ptrdiff_t len, int lag,
 | 
				
			||||||
                                      double *autoc)
 | 
					                                      double *autoc)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    int j;
 | 
					    int j;
 | 
				
			||||||
 | 
				
			|||||||
@ -38,7 +38,7 @@ static void test_window(int len)
 | 
				
			|||||||
    LOCAL_ALIGNED(16, double, dst0, [5000]);
 | 
					    LOCAL_ALIGNED(16, double, dst0, [5000]);
 | 
				
			||||||
    LOCAL_ALIGNED(16, double, dst1, [5000]);
 | 
					    LOCAL_ALIGNED(16, double, dst1, [5000]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    declare_func(void, int32_t *in, int len, double *out);
 | 
					    declare_func(void, const int32_t *in, ptrdiff_t len, double *out);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    randomize_int32(src, len);
 | 
					    randomize_int32(src, len);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user